diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:17 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:17 -0400 |
commit | 1664949843e8c0782c8f2e40897285a8dfffdf27 (patch) | |
tree | 95bbb8896519e5ab84c5fca723ecd9cb36f4796e /drivers/ide/ide-generic.c | |
parent | d083c03f2524af699a6b85cf4d2f8090242b1b84 (diff) |
ide-generic: 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/ide/ide-generic.c')
-rw-r--r-- | drivers/ide/ide-generic.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 19f63e393d18..12de09aaef09 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c | |||
@@ -94,7 +94,24 @@ static int __init ide_generic_init(void) | |||
94 | unsigned long io_addr = ide_default_io_base(i); | 94 | unsigned long io_addr = ide_default_io_base(i); |
95 | hw_regs_t hw; | 95 | hw_regs_t hw; |
96 | 96 | ||
97 | idx[i] = 0xff; | ||
98 | |||
97 | if (io_addr) { | 99 | if (io_addr) { |
100 | if (!request_region(io_addr, 8, DRV_NAME)) { | ||
101 | printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX " | ||
102 | "not free.\n", | ||
103 | DRV_NAME, io_addr, io_addr + 7); | ||
104 | continue; | ||
105 | } | ||
106 | |||
107 | if (!request_region(io_addr + 0x206, 1, DRV_NAME)) { | ||
108 | printk(KERN_ERR "%s: I/O resource 0x%lX " | ||
109 | "not free.\n", | ||
110 | DRV_NAME, io_addr + 0x206); | ||
111 | release_region(io_addr, 8); | ||
112 | continue; | ||
113 | } | ||
114 | |||
98 | /* | 115 | /* |
99 | * Skip probing if the corresponding | 116 | * Skip probing if the corresponding |
100 | * slot is already occupied. | 117 | * slot is already occupied. |
@@ -109,10 +126,10 @@ static int __init ide_generic_init(void) | |||
109 | ide_std_init_ports(&hw, io_addr, io_addr + 0x206); | 126 | ide_std_init_ports(&hw, io_addr, io_addr + 0x206); |
110 | hw.irq = ide_default_irq(io_addr); | 127 | hw.irq = ide_default_irq(io_addr); |
111 | ide_init_port_hw(hwif, &hw); | 128 | ide_init_port_hw(hwif, &hw); |
129 | hwif->mmio = 1; | ||
112 | 130 | ||
113 | idx[i] = i; | 131 | idx[i] = i; |
114 | } else | 132 | } |
115 | idx[i] = 0xff; | ||
116 | } | 133 | } |
117 | 134 | ||
118 | ide_device_add_all(idx, NULL); | 135 | ide_device_add_all(idx, NULL); |