diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:18 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:18 -0400 |
commit | 2305d94321bbbdc461acfb24b41fbf50f8a6dd91 (patch) | |
tree | 321e06f595c467296513267db63d0faa04c74569 /drivers | |
parent | 2c4be251be1cace01a2a18bf5abb847010516511 (diff) |
ide_arm: manage I/O resources in driver
* Tell IDE layer to not manage resources by setting hwif->mmio flag.
* Use {request,release}_region() for resources management.
* Use driver name for resources management.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/arm/ide_arm.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c index 82643df7c49a..a05d3dfe256c 100644 --- a/drivers/ide/arm/ide_arm.c +++ b/drivers/ide/arm/ide_arm.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <asm/mach-types.h> | 14 | #include <asm/mach-types.h> |
15 | #include <asm/irq.h> | 15 | #include <asm/irq.h> |
16 | 16 | ||
17 | #define DRV_NAME "ide_arm" | ||
18 | |||
17 | #ifdef CONFIG_ARCH_CLPS7500 | 19 | #ifdef CONFIG_ARCH_CLPS7500 |
18 | # include <asm/arch/hardware.h> | 20 | # include <asm/arch/hardware.h> |
19 | # | 21 | # |
@@ -28,15 +30,30 @@ static int __init ide_arm_init(void) | |||
28 | { | 30 | { |
29 | ide_hwif_t *hwif; | 31 | ide_hwif_t *hwif; |
30 | hw_regs_t hw; | 32 | hw_regs_t hw; |
33 | unsigned long base = IDE_ARM_IO, ctl = IDE_ARM_IO + 0x206; | ||
31 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 34 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
32 | 35 | ||
36 | if (!request_region(base, 8, DRV_NAME)) { | ||
37 | printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n", | ||
38 | DRV_NAME, base, base + 7); | ||
39 | return -EBUSY; | ||
40 | } | ||
41 | |||
42 | if (!request_region(ctl, 1, DRV_NAME)) { | ||
43 | printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n", | ||
44 | DRV_NAME, ctl); | ||
45 | release_region(base, 8); | ||
46 | return -EBUSY; | ||
47 | } | ||
48 | |||
33 | memset(&hw, 0, sizeof(hw)); | 49 | memset(&hw, 0, sizeof(hw)); |
34 | ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206); | 50 | ide_std_init_ports(&hw, base, ctl); |
35 | hw.irq = IDE_ARM_IRQ; | 51 | hw.irq = IDE_ARM_IRQ; |
36 | 52 | ||
37 | hwif = ide_find_port(); | 53 | hwif = ide_find_port(); |
38 | if (hwif) { | 54 | if (hwif) { |
39 | ide_init_port_hw(hwif, &hw); | 55 | ide_init_port_hw(hwif, &hw); |
56 | hwif->mmio = 1; | ||
40 | idx[0] = hwif->index; | 57 | idx[0] = hwif->index; |
41 | 58 | ||
42 | ide_device_add(idx, NULL); | 59 | ide_device_add(idx, NULL); |