diff options
Diffstat (limited to 'drivers/ide/ide-iops.c')
| -rw-r--r-- | drivers/ide/ide-iops.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 45944219eea0..9c646bd63549 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
| @@ -159,17 +159,20 @@ EXPORT_SYMBOL(default_hwif_mmiops); | |||
| 159 | void SELECT_DRIVE (ide_drive_t *drive) | 159 | void SELECT_DRIVE (ide_drive_t *drive) |
| 160 | { | 160 | { |
| 161 | ide_hwif_t *hwif = drive->hwif; | 161 | ide_hwif_t *hwif = drive->hwif; |
| 162 | const struct ide_port_ops *port_ops = hwif->port_ops; | ||
| 162 | 163 | ||
| 163 | if (hwif->selectproc) | 164 | if (port_ops && port_ops->selectproc) |
| 164 | hwif->selectproc(drive); | 165 | port_ops->selectproc(drive); |
| 165 | 166 | ||
| 166 | hwif->OUTB(drive->select.all, hwif->io_ports[IDE_SELECT_OFFSET]); | 167 | hwif->OUTB(drive->select.all, hwif->io_ports[IDE_SELECT_OFFSET]); |
| 167 | } | 168 | } |
| 168 | 169 | ||
| 169 | void SELECT_MASK (ide_drive_t *drive, int mask) | 170 | void SELECT_MASK (ide_drive_t *drive, int mask) |
| 170 | { | 171 | { |
| 171 | if (HWIF(drive)->maskproc) | 172 | const struct ide_port_ops *port_ops = drive->hwif->port_ops; |
| 172 | HWIF(drive)->maskproc(drive, mask); | 173 | |
| 174 | if (port_ops && port_ops->maskproc) | ||
| 175 | port_ops->maskproc(drive, mask); | ||
| 173 | } | 176 | } |
| 174 | 177 | ||
| 175 | /* | 178 | /* |
| @@ -429,7 +432,7 @@ int drive_is_ready (ide_drive_t *drive) | |||
| 429 | u8 stat = 0; | 432 | u8 stat = 0; |
| 430 | 433 | ||
| 431 | if (drive->waiting_for_dma) | 434 | if (drive->waiting_for_dma) |
| 432 | return hwif->ide_dma_test_irq(drive); | 435 | return hwif->dma_ops->dma_test_irq(drive); |
| 433 | 436 | ||
| 434 | #if 0 | 437 | #if 0 |
| 435 | /* need to guarantee 400ns since last command was issued */ | 438 | /* need to guarantee 400ns since last command was issued */ |
| @@ -700,8 +703,8 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed) | |||
| 700 | // msleep(50); | 703 | // msleep(50); |
| 701 | 704 | ||
| 702 | #ifdef CONFIG_BLK_DEV_IDEDMA | 705 | #ifdef CONFIG_BLK_DEV_IDEDMA |
| 703 | if (hwif->dma_host_set) /* check if host supports DMA */ | 706 | if (hwif->dma_ops) /* check if host supports DMA */ |
| 704 | hwif->dma_host_set(drive, 0); | 707 | hwif->dma_ops->dma_host_set(drive, 0); |
| 705 | #endif | 708 | #endif |
| 706 | 709 | ||
| 707 | /* Skip setting PIO flow-control modes on pre-EIDE drives */ | 710 | /* Skip setting PIO flow-control modes on pre-EIDE drives */ |
| @@ -759,8 +762,8 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed) | |||
| 759 | #ifdef CONFIG_BLK_DEV_IDEDMA | 762 | #ifdef CONFIG_BLK_DEV_IDEDMA |
| 760 | if ((speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA)) && | 763 | if ((speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA)) && |
| 761 | drive->using_dma) | 764 | drive->using_dma) |
| 762 | hwif->dma_host_set(drive, 1); | 765 | hwif->dma_ops->dma_host_set(drive, 1); |
| 763 | else if (hwif->dma_host_set) /* check if host supports DMA */ | 766 | else if (hwif->dma_ops) /* check if host supports DMA */ |
| 764 | ide_dma_off_quietly(drive); | 767 | ide_dma_off_quietly(drive); |
| 765 | #endif | 768 | #endif |
| 766 | 769 | ||
| @@ -905,10 +908,11 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive) | |||
| 905 | { | 908 | { |
| 906 | ide_hwgroup_t *hwgroup = HWGROUP(drive); | 909 | ide_hwgroup_t *hwgroup = HWGROUP(drive); |
| 907 | ide_hwif_t *hwif = HWIF(drive); | 910 | ide_hwif_t *hwif = HWIF(drive); |
| 911 | const struct ide_port_ops *port_ops = hwif->port_ops; | ||
| 908 | u8 tmp; | 912 | u8 tmp; |
| 909 | 913 | ||
| 910 | if (hwif->reset_poll != NULL) { | 914 | if (port_ops && port_ops->reset_poll) { |
| 911 | if (hwif->reset_poll(drive)) { | 915 | if (port_ops->reset_poll(drive)) { |
| 912 | printk(KERN_ERR "%s: host reset_poll failure for %s.\n", | 916 | printk(KERN_ERR "%s: host reset_poll failure for %s.\n", |
| 913 | hwif->name, drive->name); | 917 | hwif->name, drive->name); |
| 914 | return ide_stopped; | 918 | return ide_stopped; |
| @@ -974,6 +978,8 @@ static void ide_disk_pre_reset(ide_drive_t *drive) | |||
| 974 | 978 | ||
| 975 | static void pre_reset(ide_drive_t *drive) | 979 | static void pre_reset(ide_drive_t *drive) |
| 976 | { | 980 | { |
| 981 | const struct ide_port_ops *port_ops = drive->hwif->port_ops; | ||
| 982 | |||
| 977 | if (drive->media == ide_disk) | 983 | if (drive->media == ide_disk) |
| 978 | ide_disk_pre_reset(drive); | 984 | ide_disk_pre_reset(drive); |
| 979 | else | 985 | else |
| @@ -994,8 +1000,8 @@ static void pre_reset(ide_drive_t *drive) | |||
| 994 | return; | 1000 | return; |
| 995 | } | 1001 | } |
| 996 | 1002 | ||
| 997 | if (HWIF(drive)->pre_reset != NULL) | 1003 | if (port_ops && port_ops->pre_reset) |
| 998 | HWIF(drive)->pre_reset(drive); | 1004 | port_ops->pre_reset(drive); |
| 999 | 1005 | ||
| 1000 | if (drive->current_speed != 0xff) | 1006 | if (drive->current_speed != 0xff) |
| 1001 | drive->desired_speed = drive->current_speed; | 1007 | drive->desired_speed = drive->current_speed; |
| @@ -1023,6 +1029,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi) | |||
| 1023 | unsigned long flags; | 1029 | unsigned long flags; |
| 1024 | ide_hwif_t *hwif; | 1030 | ide_hwif_t *hwif; |
| 1025 | ide_hwgroup_t *hwgroup; | 1031 | ide_hwgroup_t *hwgroup; |
| 1032 | const struct ide_port_ops *port_ops; | ||
| 1026 | u8 ctl; | 1033 | u8 ctl; |
| 1027 | 1034 | ||
| 1028 | spin_lock_irqsave(&ide_lock, flags); | 1035 | spin_lock_irqsave(&ide_lock, flags); |
| @@ -1089,8 +1096,9 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi) | |||
| 1089 | * state when the disks are reset this way. At least, the Winbond | 1096 | * state when the disks are reset this way. At least, the Winbond |
| 1090 | * 553 documentation says that | 1097 | * 553 documentation says that |
| 1091 | */ | 1098 | */ |
| 1092 | if (hwif->resetproc) | 1099 | port_ops = hwif->port_ops; |
| 1093 | hwif->resetproc(drive); | 1100 | if (port_ops && port_ops->resetproc) |
| 1101 | port_ops->resetproc(drive); | ||
| 1094 | 1102 | ||
| 1095 | spin_unlock_irqrestore(&ide_lock, flags); | 1103 | spin_unlock_irqrestore(&ide_lock, flags); |
| 1096 | return ide_started; | 1104 | return ide_started; |
