summaryrefslogtreecommitdiff
path: root/drivers/of/platform.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-12-18 11:45:17 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-01-25 11:02:01 +0000
commitc0f72f8a9279f82520fc476c32c09f693661c5f4 (patch)
treee22e2234b79411ac95f711a266a2614ed36fcd0e /drivers/of/platform.c
parentd5dc9271b25822f36d299f8cab985379743424b9 (diff)
ARM: amba: of: convert to use amba_device_alloc
Convert DT code to use the new amba_device_alloc APIs. Acked-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r--drivers/of/platform.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 63b3ec48c203..cae9477a6ed3 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -253,7 +253,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
if (!of_device_is_available(node))
return NULL;
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ dev = amba_device_alloc(NULL, 0, 0);
if (!dev)
return NULL;
@@ -283,14 +283,14 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
if (ret)
goto err_free;
- ret = amba_device_register(dev, &iomem_resource);
+ ret = amba_device_add(dev, &iomem_resource);
if (ret)
goto err_free;
return dev;
err_free:
- kfree(dev);
+ amba_device_put(dev);
return NULL;
}
#else /* CONFIG_ARM_AMBA */