diff options
-rw-r--r-- | drivers/ide/ide.c | 50 | ||||
-rw-r--r-- | include/linux/ide.h | 1 |
2 files changed, 0 insertions, 51 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 694d997ce50f..3d989c298ff4 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -227,56 +227,6 @@ static int ide_system_bus_speed(void) | |||
227 | return pci_dev_present(pci_default) ? 33 : 50; | 227 | return pci_dev_present(pci_default) ? 33 : 50; |
228 | } | 228 | } |
229 | 229 | ||
230 | static struct resource* hwif_request_region(ide_hwif_t *hwif, | ||
231 | unsigned long addr, int num) | ||
232 | { | ||
233 | struct resource *res = request_region(addr, num, hwif->name); | ||
234 | |||
235 | if (!res) | ||
236 | printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n", | ||
237 | hwif->name, addr, addr+num-1); | ||
238 | return res; | ||
239 | } | ||
240 | |||
241 | /** | ||
242 | * ide_hwif_request_regions - request resources for IDE | ||
243 | * @hwif: interface to use | ||
244 | * | ||
245 | * Requests all the needed resources for an interface. | ||
246 | * Right now core IDE code does this work which is deeply wrong. | ||
247 | * MMIO leaves it to the controller driver, | ||
248 | * PIO will migrate this way over time. | ||
249 | */ | ||
250 | |||
251 | int ide_hwif_request_regions(ide_hwif_t *hwif) | ||
252 | { | ||
253 | unsigned long addr; | ||
254 | |||
255 | if (hwif->mmio) | ||
256 | return 0; | ||
257 | |||
258 | addr = hwif->io_ports[IDE_CONTROL_OFFSET]; | ||
259 | |||
260 | if (addr && !hwif_request_region(hwif, addr, 1)) | ||
261 | goto control_region_busy; | ||
262 | |||
263 | addr = hwif->io_ports[IDE_DATA_OFFSET]; | ||
264 | BUG_ON((addr | 7) != hwif->io_ports[IDE_STATUS_OFFSET]); | ||
265 | |||
266 | if (!hwif_request_region(hwif, addr, 8)) | ||
267 | goto data_region_busy; | ||
268 | |||
269 | return 0; | ||
270 | |||
271 | data_region_busy: | ||
272 | addr = hwif->io_ports[IDE_CONTROL_OFFSET]; | ||
273 | if (addr) | ||
274 | release_region(addr, 1); | ||
275 | control_region_busy: | ||
276 | /* If any errors are return, we drop the hwif interface. */ | ||
277 | return -EBUSY; | ||
278 | } | ||
279 | |||
280 | void ide_remove_port_from_hwgroup(ide_hwif_t *hwif) | 230 | void ide_remove_port_from_hwgroup(ide_hwif_t *hwif) |
281 | { | 231 | { |
282 | ide_hwgroup_t *hwgroup = hwif->hwgroup; | 232 | ide_hwgroup_t *hwgroup = hwif->hwgroup; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 4204d1f35ece..d3d64116957b 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1202,7 +1202,6 @@ static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} | |||
1202 | #endif | 1202 | #endif |
1203 | 1203 | ||
1204 | void ide_remove_port_from_hwgroup(ide_hwif_t *); | 1204 | void ide_remove_port_from_hwgroup(ide_hwif_t *); |
1205 | extern int ide_hwif_request_regions(ide_hwif_t *hwif); | ||
1206 | void ide_unregister(unsigned int); | 1205 | void ide_unregister(unsigned int); |
1207 | 1206 | ||
1208 | void ide_register_region(struct gendisk *); | 1207 | void ide_register_region(struct gendisk *); |