aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 11:36:39 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 11:36:39 -0400
commit05230e23cf02d939865a902f6ec4c1b2c82faf33 (patch)
tree217ac1e260162bf1614faa0d3dddc350e971508a /drivers/ide/ide.c
parent951784b667d78dad52ffea0a958fdbe14da97972 (diff)
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/ide/ide.c')
-rw-r--r--drivers/ide/ide.c36
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,
251int ide_hwif_request_regions(ide_hwif_t *hwif) 251int ide_hwif_request_regions(ide_hwif_t *hwif)
252{ 252{
253 unsigned long addr; 253 unsigned long addr;
254 unsigned int i;
255 254
256 if (hwif->mmio) 255 if (hwif->mmio)
257 return 0; 256 return 0;
257
258 addr = hwif->io_ports[IDE_CONTROL_OFFSET]; 258 addr = hwif->io_ports[IDE_CONTROL_OFFSET];
259
259 if (addr && !hwif_request_region(hwif, addr, 1)) 260 if (addr && !hwif_request_region(hwif, addr, 1))
260 goto control_region_busy; 261 goto control_region_busy;
261 hwif->straight8 = 0; 262
262 addr = hwif->io_ports[IDE_DATA_OFFSET]; 263 addr = hwif->io_ports[IDE_DATA_OFFSET];
263 if ((addr | 7) == hwif->io_ports[IDE_STATUS_OFFSET]) { 264 BUG_ON((addr | 7) != hwif->io_ports[IDE_STATUS_OFFSET]);
264 if (!hwif_request_region(hwif, addr, 8)) 265
265 goto data_region_busy; 266 if (!hwif_request_region(hwif, addr, 8))
266 hwif->straight8 = 1; 267 goto data_region_busy;
267 return 0; 268
268 }
269 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
270 addr = hwif->io_ports[i];
271 if (!hwif_request_region(hwif, addr, 1)) {
272 while (--i)
273 release_region(addr, 1);
274 goto data_region_busy;
275 }
276 }
277 return 0; 269 return 0;
278 270
279data_region_busy: 271data_region_busy:
@@ -299,19 +291,13 @@ control_region_busy:
299 291
300void ide_hwif_release_regions(ide_hwif_t *hwif) 292void ide_hwif_release_regions(ide_hwif_t *hwif)
301{ 293{
302 u32 i = 0;
303
304 if (hwif->mmio) 294 if (hwif->mmio)
305 return; 295 return;
296
306 if (hwif->io_ports[IDE_CONTROL_OFFSET]) 297 if (hwif->io_ports[IDE_CONTROL_OFFSET])
307 release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); 298 release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1);
308 if (hwif->straight8) { 299
309 release_region(hwif->io_ports[IDE_DATA_OFFSET], 8); 300 release_region(hwif->io_ports[IDE_DATA_OFFSET], 8);
310 return;
311 }
312 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++)
313 if (hwif->io_ports[i])
314 release_region(hwif->io_ports[i], 1);
315} 301}
316 302
317void ide_remove_port_from_hwgroup(ide_hwif_t *hwif) 303void ide_remove_port_from_hwgroup(ide_hwif_t *hwif)