diff options
-rw-r--r-- | drivers/of/platform.c | 6 |
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, | |||
253 | if (!of_device_is_available(node)) | 253 | if (!of_device_is_available(node)) |
254 | return NULL; | 254 | return NULL; |
255 | 255 | ||
256 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 256 | dev = amba_device_alloc(NULL, 0, 0); |
257 | if (!dev) | 257 | if (!dev) |
258 | return NULL; | 258 | return NULL; |
259 | 259 | ||
@@ -283,14 +283,14 @@ static struct amba_device *of_amba_device_create(struct device_node *node, | |||
283 | if (ret) | 283 | if (ret) |
284 | goto err_free; | 284 | goto err_free; |
285 | 285 | ||
286 | ret = amba_device_register(dev, &iomem_resource); | 286 | ret = amba_device_add(dev, &iomem_resource); |
287 | if (ret) | 287 | if (ret) |
288 | goto err_free; | 288 | goto err_free; |
289 | 289 | ||
290 | return dev; | 290 | return dev; |
291 | 291 | ||
292 | err_free: | 292 | err_free: |
293 | kfree(dev); | 293 | amba_device_put(dev); |
294 | return NULL; | 294 | return NULL; |
295 | } | 295 | } |
296 | #else /* CONFIG_ARM_AMBA */ | 296 | #else /* CONFIG_ARM_AMBA */ |