diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-04-03 06:59:50 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-04-19 14:31:34 -0400 |
commit | 4ff35d863ea2cbce2dc6c708b80be12e5b74226b (patch) | |
tree | f56d05aa75d50f142981ea80047204686d8807b4 /arch/arm/mach-integrator | |
parent | 5002484b8ac93e8d32ca75e8a7504dbb9f7926fe (diff) |
ARM: 7371/1: integrator: factor out dynamic amba device allocator
Replace the local amba device allocator with the core code from
the bus driver.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r-- | arch/arm/mach-integrator/impd1.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 3e538da6cb1f..e428f3ab15c7 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
@@ -398,24 +398,16 @@ static int impd1_probe(struct lm_device *dev) | |||
398 | struct impd1_device *idev = impd1_devs + i; | 398 | struct impd1_device *idev = impd1_devs + i; |
399 | struct amba_device *d; | 399 | struct amba_device *d; |
400 | unsigned long pc_base; | 400 | unsigned long pc_base; |
401 | char devname[32]; | ||
401 | 402 | ||
402 | pc_base = dev->resource.start + idev->offset; | 403 | pc_base = dev->resource.start + idev->offset; |
403 | 404 | snprintf(devname, 32, "lm%x:%5.5lx", dev->id, idev->offset >> 12); | |
404 | d = amba_device_alloc(NULL, pc_base, SZ_4K); | 405 | d = amba_ahb_device_add(&dev->dev, devname, pc_base, SZ_4K, |
405 | if (!d) | 406 | dev->irq, dev->irq, |
407 | idev->platform_data, idev->id); | ||
408 | if (IS_ERR(d)) { | ||
409 | dev_err(&dev->dev, "unable to register device: %ld\n", PTR_ERR(d)); | ||
406 | continue; | 410 | continue; |
407 | |||
408 | dev_set_name(&d->dev, "lm%x:%5.5lx", dev->id, idev->offset >> 12); | ||
409 | d->dev.parent = &dev->dev; | ||
410 | d->irq[0] = dev->irq; | ||
411 | d->irq[1] = dev->irq; | ||
412 | d->periphid = idev->id; | ||
413 | d->dev.platform_data = idev->platform_data; | ||
414 | |||
415 | ret = amba_device_add(d, &dev->resource); | ||
416 | if (ret) { | ||
417 | dev_err(&d->dev, "unable to register device: %d\n", ret); | ||
418 | amba_device_put(d); | ||
419 | } | 411 | } |
420 | } | 412 | } |
421 | 413 | ||