diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-03-31 14:15:32 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:32 -0400 |
commit | abb596b25edac1ec1acc4ef53df190771661c3d2 (patch) | |
tree | d20ea24960358ce03e0f27eefd2e6911afd1309c /drivers/ide/ns87415.c | |
parent | 0f861e8c47ede537a8ad280c61d5d00d541f04db (diff) |
ide: turn selectproc() method into dev_select() method (take 5)
Turn selectproc() method into dev_select() method by teaching it to write to the
device register and moving it from 'struct ide_port_ops' to 'struct ide_tp_ops'.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: benh@kernel.crashing.org
Cc: petkovbb@gmail.com
[bart: add ->dev_select to at91_ide.c and tx4939.c (__BIG_ENDIAN case)]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ns87415.c')
-rw-r--r-- | drivers/ide/ns87415.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c index 9f6dff83b141..af1b421eb450 100644 --- a/drivers/ide/ns87415.c +++ b/drivers/ide/ns87415.c | |||
@@ -98,12 +98,15 @@ static void superio_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | static void ns87415_dev_select(ide_drive_t *drive); | ||
102 | |||
101 | static const struct ide_tp_ops superio_tp_ops = { | 103 | static const struct ide_tp_ops superio_tp_ops = { |
102 | .exec_command = ide_exec_command, | 104 | .exec_command = ide_exec_command, |
103 | .read_status = superio_read_status, | 105 | .read_status = superio_read_status, |
104 | .read_altstatus = ide_read_altstatus, | 106 | .read_altstatus = ide_read_altstatus, |
105 | .write_devctl = ide_write_devctl, | 107 | .write_devctl = ide_write_devctl, |
106 | 108 | ||
109 | .dev_select = ns87415_dev_select, | ||
107 | .tf_load = ide_tf_load, | 110 | .tf_load = ide_tf_load, |
108 | .tf_read = superio_tf_read, | 111 | .tf_read = superio_tf_read, |
109 | 112 | ||
@@ -182,10 +185,12 @@ static void ns87415_prepare_drive (ide_drive_t *drive, unsigned int use_dma) | |||
182 | local_irq_restore(flags); | 185 | local_irq_restore(flags); |
183 | } | 186 | } |
184 | 187 | ||
185 | static void ns87415_selectproc (ide_drive_t *drive) | 188 | static void ns87415_dev_select(ide_drive_t *drive) |
186 | { | 189 | { |
187 | ns87415_prepare_drive(drive, | 190 | ns87415_prepare_drive(drive, |
188 | !!(drive->dev_flags & IDE_DFLAG_USING_DMA)); | 191 | !!(drive->dev_flags & IDE_DFLAG_USING_DMA)); |
192 | |||
193 | outb(drive->select | ATA_DEVICE_OBS, drive->hwif->io_ports.device_addr); | ||
189 | } | 194 | } |
190 | 195 | ||
191 | static void ns87415_dma_start(ide_drive_t *drive) | 196 | static void ns87415_dma_start(ide_drive_t *drive) |
@@ -229,7 +234,7 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) | |||
229 | * Also, leave IRQ masked during drive probing, to prevent infinite | 234 | * Also, leave IRQ masked during drive probing, to prevent infinite |
230 | * interrupts from a potentially floating INTA.. | 235 | * interrupts from a potentially floating INTA.. |
231 | * | 236 | * |
232 | * IRQs get unmasked in selectproc when drive is first used. | 237 | * IRQs get unmasked in dev_select() when drive is first used. |
233 | */ | 238 | */ |
234 | (void) pci_read_config_dword(dev, 0x40, &ctrl); | 239 | (void) pci_read_config_dword(dev, 0x40, &ctrl); |
235 | (void) pci_read_config_byte(dev, 0x09, &progif); | 240 | (void) pci_read_config_byte(dev, 0x09, &progif); |
@@ -281,8 +286,18 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) | |||
281 | outb(0x60, hwif->dma_base + ATA_DMA_STATUS); | 286 | outb(0x60, hwif->dma_base + ATA_DMA_STATUS); |
282 | } | 287 | } |
283 | 288 | ||
284 | static const struct ide_port_ops ns87415_port_ops = { | 289 | static const struct ide_tp_ops ns87415_tp_ops = { |
285 | .selectproc = ns87415_selectproc, | 290 | .exec_command = ide_exec_command, |
291 | .read_status = ide_read_status, | ||
292 | .read_altstatus = ide_read_altstatus, | ||
293 | .write_devctl = ide_write_devctl, | ||
294 | |||
295 | .dev_select = ns87415_dev_select, | ||
296 | .tf_load = ide_tf_load, | ||
297 | .tf_read = ide_tf_read, | ||
298 | |||
299 | .input_data = ide_input_data, | ||
300 | .output_data = ide_output_data, | ||
286 | }; | 301 | }; |
287 | 302 | ||
288 | static const struct ide_dma_ops ns87415_dma_ops = { | 303 | static const struct ide_dma_ops ns87415_dma_ops = { |
@@ -299,7 +314,7 @@ static const struct ide_dma_ops ns87415_dma_ops = { | |||
299 | static const struct ide_port_info ns87415_chipset __devinitdata = { | 314 | static const struct ide_port_info ns87415_chipset __devinitdata = { |
300 | .name = DRV_NAME, | 315 | .name = DRV_NAME, |
301 | .init_hwif = init_hwif_ns87415, | 316 | .init_hwif = init_hwif_ns87415, |
302 | .port_ops = &ns87415_port_ops, | 317 | .tp_ops = &ns87415_tp_ops, |
303 | .dma_ops = &ns87415_dma_ops, | 318 | .dma_ops = &ns87415_dma_ops, |
304 | .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | | 319 | .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | |
305 | IDE_HFLAG_NO_ATAPI_DMA, | 320 | IDE_HFLAG_NO_ATAPI_DMA, |