aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r--drivers/ide/ide.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index c750f6ce770a..b3c0818c5c6c 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -389,9 +389,8 @@ int ide_hwif_request_regions(ide_hwif_t *hwif)
389 unsigned long addr; 389 unsigned long addr;
390 unsigned int i; 390 unsigned int i;
391 391
392 if (hwif->mmio == 2) 392 if (hwif->mmio)
393 return 0; 393 return 0;
394 BUG_ON(hwif->mmio == 1);
395 addr = hwif->io_ports[IDE_CONTROL_OFFSET]; 394 addr = hwif->io_ports[IDE_CONTROL_OFFSET];
396 if (addr && !hwif_request_region(hwif, addr, 1)) 395 if (addr && !hwif_request_region(hwif, addr, 1))
397 goto control_region_busy; 396 goto control_region_busy;
@@ -438,7 +437,7 @@ void ide_hwif_release_regions(ide_hwif_t *hwif)
438{ 437{
439 u32 i = 0; 438 u32 i = 0;
440 439
441 if (hwif->mmio == 2) 440 if (hwif->mmio)
442 return; 441 return;
443 if (hwif->io_ports[IDE_CONTROL_OFFSET]) 442 if (hwif->io_ports[IDE_CONTROL_OFFSET])
444 release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); 443 release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1);
@@ -507,23 +506,22 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
507 hwif->ide_dma_end = tmp_hwif->ide_dma_end; 506 hwif->ide_dma_end = tmp_hwif->ide_dma_end;
508 hwif->ide_dma_check = tmp_hwif->ide_dma_check; 507 hwif->ide_dma_check = tmp_hwif->ide_dma_check;
509 hwif->ide_dma_on = tmp_hwif->ide_dma_on; 508 hwif->ide_dma_on = tmp_hwif->ide_dma_on;
510 hwif->ide_dma_off_quietly = tmp_hwif->ide_dma_off_quietly; 509 hwif->dma_off_quietly = tmp_hwif->dma_off_quietly;
511 hwif->ide_dma_test_irq = tmp_hwif->ide_dma_test_irq; 510 hwif->ide_dma_test_irq = tmp_hwif->ide_dma_test_irq;
512 hwif->ide_dma_host_on = tmp_hwif->ide_dma_host_on; 511 hwif->ide_dma_clear_irq = tmp_hwif->ide_dma_clear_irq;
513 hwif->ide_dma_host_off = tmp_hwif->ide_dma_host_off; 512 hwif->dma_host_on = tmp_hwif->dma_host_on;
513 hwif->dma_host_off = tmp_hwif->dma_host_off;
514 hwif->ide_dma_lostirq = tmp_hwif->ide_dma_lostirq; 514 hwif->ide_dma_lostirq = tmp_hwif->ide_dma_lostirq;
515 hwif->ide_dma_timeout = tmp_hwif->ide_dma_timeout; 515 hwif->ide_dma_timeout = tmp_hwif->ide_dma_timeout;
516 516
517 hwif->OUTB = tmp_hwif->OUTB; 517 hwif->OUTB = tmp_hwif->OUTB;
518 hwif->OUTBSYNC = tmp_hwif->OUTBSYNC; 518 hwif->OUTBSYNC = tmp_hwif->OUTBSYNC;
519 hwif->OUTW = tmp_hwif->OUTW; 519 hwif->OUTW = tmp_hwif->OUTW;
520 hwif->OUTL = tmp_hwif->OUTL;
521 hwif->OUTSW = tmp_hwif->OUTSW; 520 hwif->OUTSW = tmp_hwif->OUTSW;
522 hwif->OUTSL = tmp_hwif->OUTSL; 521 hwif->OUTSL = tmp_hwif->OUTSL;
523 522
524 hwif->INB = tmp_hwif->INB; 523 hwif->INB = tmp_hwif->INB;
525 hwif->INW = tmp_hwif->INW; 524 hwif->INW = tmp_hwif->INW;
526 hwif->INL = tmp_hwif->INL;
527 hwif->INSW = tmp_hwif->INSW; 525 hwif->INSW = tmp_hwif->INSW;
528 hwif->INSL = tmp_hwif->INSL; 526 hwif->INSL = tmp_hwif->INSL;
529 527
@@ -551,7 +549,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
551 hwif->extra_ports = tmp_hwif->extra_ports; 549 hwif->extra_ports = tmp_hwif->extra_ports;
552 hwif->autodma = tmp_hwif->autodma; 550 hwif->autodma = tmp_hwif->autodma;
553 hwif->udma_four = tmp_hwif->udma_four; 551 hwif->udma_four = tmp_hwif->udma_four;
554 hwif->no_dsc = tmp_hwif->no_dsc;
555 552
556 hwif->hwif_data = tmp_hwif->hwif_data; 553 hwif->hwif_data = tmp_hwif->hwif_data;
557} 554}
@@ -1138,12 +1135,11 @@ static int set_using_dma (ide_drive_t *drive, int arg)
1138 if (HWIF(drive)->ide_dma_check == NULL) 1135 if (HWIF(drive)->ide_dma_check == NULL)
1139 return -EPERM; 1136 return -EPERM;
1140 if (arg) { 1137 if (arg) {
1141 if (HWIF(drive)->ide_dma_check(drive)) return -EIO; 1138 if (ide_set_dma(drive))
1142 if (HWIF(drive)->ide_dma_on(drive)) return -EIO;
1143 } else {
1144 if (__ide_dma_off(drive))
1145 return -EIO; 1139 return -EIO;
1146 } 1140 if (HWIF(drive)->ide_dma_on(drive)) return -EIO;
1141 } else
1142 ide_dma_off(drive);
1147 return 0; 1143 return 0;
1148#else 1144#else
1149 return -EPERM; 1145 return -EPERM;