提交 c0f72f8a 编写于 作者: R Russell King

ARM: amba: of: convert to use amba_device_alloc

Convert DT code to use the new amba_device_alloc APIs.
Acked-by: NRob Herring <rob.herring@calxeda.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 d5dc9271
...@@ -253,7 +253,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node, ...@@ -253,7 +253,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
if (!of_device_is_available(node)) if (!of_device_is_available(node))
return NULL; return NULL;
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = amba_device_alloc(NULL, 0, 0);
if (!dev) if (!dev)
return NULL; return NULL;
...@@ -283,14 +283,14 @@ static struct amba_device *of_amba_device_create(struct device_node *node, ...@@ -283,14 +283,14 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
if (ret) if (ret)
goto err_free; goto err_free;
ret = amba_device_register(dev, &iomem_resource); ret = amba_device_add(dev, &iomem_resource);
if (ret) if (ret)
goto err_free; goto err_free;
return dev; return dev;
err_free: err_free:
kfree(dev); amba_device_put(dev);
return NULL; return NULL;
} }
#else /* CONFIG_ARM_AMBA */ #else /* CONFIG_ARM_AMBA */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册