diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-12-18 11:20:37 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-25 11:02:02 +0000 |
commit | 9a25706b71ea06c3e2cfd165ebf98a5557ecdd0e (patch) | |
tree | 9e6294903b86d5345ce9b12194c4cf4c949d60b4 /arch | |
parent | 46d4bb9b52829c7d94c528201f27f6288be3f45e (diff) | |
download | linux-9a25706b71ea06c3e2cfd165ebf98a5557ecdd0e.tar.gz linux-9a25706b71ea06c3e2cfd165ebf98a5557ecdd0e.tar.bz2 linux-9a25706b71ea06c3e2cfd165ebf98a5557ecdd0e.zip |
ARM: amba: integrator: convert to use amba_device_alloc
Convert Integrator IM/PD-1 to use the new amba_device_alloc APIs.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-integrator/impd1.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 8cbb75a96bd4..3e538da6cb1f 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c @@ -401,24 +401,21 @@ static int impd1_probe(struct lm_device *dev) pc_base = dev->resource.start + idev->offset; - d = kzalloc(sizeof(struct amba_device), GFP_KERNEL); + d = amba_device_alloc(NULL, pc_base, SZ_4K); if (!d) continue; dev_set_name(&d->dev, "lm%x:%5.5lx", dev->id, idev->offset >> 12); d->dev.parent = &dev->dev; - d->res.start = dev->resource.start + idev->offset; - d->res.end = d->res.start + SZ_4K - 1; - d->res.flags = IORESOURCE_MEM; d->irq[0] = dev->irq; d->irq[1] = dev->irq; d->periphid = idev->id; d->dev.platform_data = idev->platform_data; - ret = amba_device_register(d, &dev->resource); + ret = amba_device_add(d, &dev->resource); if (ret) { dev_err(&d->dev, "unable to register device: %d\n", ret); - kfree(d); + amba_device_put(d); } } |