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: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 951784b6
...@@ -251,29 +251,21 @@ static struct resource* hwif_request_region(ide_hwif_t *hwif, ...@@ -251,29 +251,21 @@ static struct resource* hwif_request_region(ide_hwif_t *hwif,
int ide_hwif_request_regions(ide_hwif_t *hwif) int ide_hwif_request_regions(ide_hwif_t *hwif)
{ {
unsigned long addr; unsigned long addr;
unsigned int i;
if (hwif->mmio) if (hwif->mmio)
return 0; return 0;
addr = hwif->io_ports[IDE_CONTROL_OFFSET]; addr = hwif->io_ports[IDE_CONTROL_OFFSET];
if (addr && !hwif_request_region(hwif, addr, 1)) if (addr && !hwif_request_region(hwif, addr, 1))
goto control_region_busy; goto control_region_busy;
hwif->straight8 = 0;
addr = hwif->io_ports[IDE_DATA_OFFSET]; addr = hwif->io_ports[IDE_DATA_OFFSET];
if ((addr | 7) == hwif->io_ports[IDE_STATUS_OFFSET]) { BUG_ON((addr | 7) != hwif->io_ports[IDE_STATUS_OFFSET]);
if (!hwif_request_region(hwif, addr, 8))
goto data_region_busy; if (!hwif_request_region(hwif, addr, 8))
hwif->straight8 = 1; goto data_region_busy;
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;
}
}
return 0; return 0;
data_region_busy: data_region_busy:
...@@ -299,19 +291,13 @@ int ide_hwif_request_regions(ide_hwif_t *hwif) ...@@ -299,19 +291,13 @@ int ide_hwif_request_regions(ide_hwif_t *hwif)
void ide_hwif_release_regions(ide_hwif_t *hwif) void ide_hwif_release_regions(ide_hwif_t *hwif)
{ {
u32 i = 0;
if (hwif->mmio) if (hwif->mmio)
return; return;
if (hwif->io_ports[IDE_CONTROL_OFFSET]) if (hwif->io_ports[IDE_CONTROL_OFFSET])
release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1);
if (hwif->straight8) {
release_region(hwif->io_ports[IDE_DATA_OFFSET], 8); 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);
} }
void ide_remove_port_from_hwgroup(ide_hwif_t *hwif) void ide_remove_port_from_hwgroup(ide_hwif_t *hwif)
......
...@@ -521,7 +521,6 @@ typedef struct hwif_s { ...@@ -521,7 +521,6 @@ typedef struct hwif_s {
unsigned reset : 1; /* reset after probe */ unsigned reset : 1; /* reset after probe */
unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
unsigned mmio : 1; /* host uses MMIO */ unsigned mmio : 1; /* host uses MMIO */
unsigned straight8 : 1; /* Alan's straight 8 check */
struct device gendev; struct device gendev;
struct device *portdev; struct device *portdev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册