Skip to content

Commit

Permalink
ARM: amba: integrator: convert to use amba_device_alloc
Browse files Browse the repository at this point in the history
Convert Integrator IM/PD-1 to use the new amba_device_alloc APIs.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Jan 25, 2012
1 parent 46d4bb9 commit 9a25706
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions arch/arm/mach-integrator/impd1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 9a25706

Please sign in to comment.