diff options
Diffstat (limited to 'drivers/ide/ide-xfer-mode.c')
-rw-r--r-- | drivers/ide/ide-xfer-mode.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/ide/ide-xfer-mode.c b/drivers/ide/ide-xfer-mode.c index 46d203ce60cc..5fc8d5c17de9 100644 --- a/drivers/ide/ide-xfer-mode.c +++ b/drivers/ide/ide-xfer-mode.c | |||
@@ -58,7 +58,7 @@ EXPORT_SYMBOL(ide_xfer_verbose); | |||
58 | * This is used by most chipset support modules when "auto-tuning". | 58 | * This is used by most chipset support modules when "auto-tuning". |
59 | */ | 59 | */ |
60 | 60 | ||
61 | u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode) | 61 | static u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode) |
62 | { | 62 | { |
63 | u16 *id = drive->id; | 63 | u16 *id = drive->id; |
64 | int pio_mode = -1, overridden = 0; | 64 | int pio_mode = -1, overridden = 0; |
@@ -105,7 +105,6 @@ u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode) | |||
105 | 105 | ||
106 | return pio_mode; | 106 | return pio_mode; |
107 | } | 107 | } |
108 | EXPORT_SYMBOL_GPL(ide_get_best_pio_mode); | ||
109 | 108 | ||
110 | int ide_pio_need_iordy(ide_drive_t *drive, const u8 pio) | 109 | int ide_pio_need_iordy(ide_drive_t *drive, const u8 pio) |
111 | { | 110 | { |
@@ -135,17 +134,20 @@ int ide_set_pio_mode(ide_drive_t *drive, const u8 mode) | |||
135 | * set transfer mode on the device in ->set_pio_mode method... | 134 | * set transfer mode on the device in ->set_pio_mode method... |
136 | */ | 135 | */ |
137 | if (port_ops->set_dma_mode == NULL) { | 136 | if (port_ops->set_dma_mode == NULL) { |
138 | port_ops->set_pio_mode(drive, mode - XFER_PIO_0); | 137 | drive->pio_mode = mode; |
138 | port_ops->set_pio_mode(hwif, drive); | ||
139 | return 0; | 139 | return 0; |
140 | } | 140 | } |
141 | 141 | ||
142 | if (hwif->host_flags & IDE_HFLAG_POST_SET_MODE) { | 142 | if (hwif->host_flags & IDE_HFLAG_POST_SET_MODE) { |
143 | if (ide_config_drive_speed(drive, mode)) | 143 | if (ide_config_drive_speed(drive, mode)) |
144 | return -1; | 144 | return -1; |
145 | port_ops->set_pio_mode(drive, mode - XFER_PIO_0); | 145 | drive->pio_mode = mode; |
146 | port_ops->set_pio_mode(hwif, drive); | ||
146 | return 0; | 147 | return 0; |
147 | } else { | 148 | } else { |
148 | port_ops->set_pio_mode(drive, mode - XFER_PIO_0); | 149 | drive->pio_mode = mode; |
150 | port_ops->set_pio_mode(hwif, drive); | ||
149 | return ide_config_drive_speed(drive, mode); | 151 | return ide_config_drive_speed(drive, mode); |
150 | } | 152 | } |
151 | } | 153 | } |
@@ -164,10 +166,12 @@ int ide_set_dma_mode(ide_drive_t *drive, const u8 mode) | |||
164 | if (hwif->host_flags & IDE_HFLAG_POST_SET_MODE) { | 166 | if (hwif->host_flags & IDE_HFLAG_POST_SET_MODE) { |
165 | if (ide_config_drive_speed(drive, mode)) | 167 | if (ide_config_drive_speed(drive, mode)) |
166 | return -1; | 168 | return -1; |
167 | port_ops->set_dma_mode(drive, mode); | 169 | drive->dma_mode = mode; |
170 | port_ops->set_dma_mode(hwif, drive); | ||
168 | return 0; | 171 | return 0; |
169 | } else { | 172 | } else { |
170 | port_ops->set_dma_mode(drive, mode); | 173 | drive->dma_mode = mode; |
174 | port_ops->set_dma_mode(hwif, drive); | ||
171 | return ide_config_drive_speed(drive, mode); | 175 | return ide_config_drive_speed(drive, mode); |
172 | } | 176 | } |
173 | } | 177 | } |