diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 17:36:39 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 17:36:39 +0200 |
commit | 05230e23cf02d939865a902f6ec4c1b2c82faf33 (patch) | |
tree | 217ac1e260162bf1614faa0d3dddc350e971508a /drivers | |
parent | ide: remove IDE_HFLAG_CY82C693 host flag (diff) | |
download | linux-05230e23cf02d939865a902f6ec4c1b2c82faf33.tar.xz linux-05230e23cf02d939865a902f6ec4c1b2c82faf33.zip |
ide: remove hwif->straight8 flag
All host drivers now either set hwif->mmio or reserve continuous
I/O resources so remove no longer needed hwif->straight8 flag
and never reached code for 'hwif->straight8 == 0' case.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide.c | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index b7a040ef12fa..f04b53cb023f 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -251,29 +251,21 @@ static struct resource* hwif_request_region(ide_hwif_t *hwif, int ide_hwif_request_regions(ide_hwif_t *hwif) { unsigned long addr; - unsigned int i; if (hwif->mmio) return 0; + addr = hwif->io_ports[IDE_CONTROL_OFFSET]; + if (addr && !hwif_request_region(hwif, addr, 1)) goto control_region_busy; - hwif->straight8 = 0; + addr = hwif->io_ports[IDE_DATA_OFFSET]; - if ((addr | 7) == hwif->io_ports[IDE_STATUS_OFFSET]) { - if (!hwif_request_region(hwif, addr, 8)) - goto data_region_busy; - hwif->straight8 = 1; - return 0; - } - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - addr = hwif->io_ports[i]; - if (!hwif_request_region(hwif, addr, 1)) { - while (--i) - release_region(addr, 1); - goto data_region_busy; - } - } + BUG_ON((addr | 7) != hwif->io_ports[IDE_STATUS_OFFSET]); + + if (!hwif_request_region(hwif, addr, 8)) + goto data_region_busy; + return 0; data_region_busy: @@ -299,19 +291,13 @@ control_region_busy: void ide_hwif_release_regions(ide_hwif_t *hwif) { - u32 i = 0; - if (hwif->mmio) return; + if (hwif->io_ports[IDE_CONTROL_OFFSET]) release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); - if (hwif->straight8) { - release_region(hwif->io_ports[IDE_DATA_OFFSET], 8); - return; - } - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) - if (hwif->io_ports[i]) - release_region(hwif->io_ports[i], 1); + + release_region(hwif->io_ports[IDE_DATA_OFFSET], 8); } void ide_remove_port_from_hwgroup(ide_hwif_t *hwif) |