ide: add struct ide_port_ops (take 2)
* Move hooks for port/host specific methods from ide_hwif_t to 'struct ide_port_ops'. * Add 'const struct ide_port_ops *port_ops' to 'struct ide_port_info' and ide_hwif_t. * Update host drivers and core code accordingly. While at it: * Rename ata66_*() cable detect functions to *_cable_detect() to match the standard naming. (Suggested by Sergei Shtylyov) v2: * Fix build for bast-ide. (Noticed by Andrew Morton) Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
@@ -721,6 +721,7 @@ static ide_startstop_t do_special (ide_drive_t *drive)
|
||||
#endif
|
||||
if (s->b.set_tune) {
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
const struct ide_port_ops *port_ops = hwif->port_ops;
|
||||
u8 req_pio = drive->tune_req;
|
||||
|
||||
s->b.set_tune = 0;
|
||||
@@ -733,10 +734,10 @@ static ide_startstop_t do_special (ide_drive_t *drive)
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&ide_lock, flags);
|
||||
hwif->set_pio_mode(drive, req_pio);
|
||||
port_ops->set_pio_mode(drive, req_pio);
|
||||
spin_unlock_irqrestore(&ide_lock, flags);
|
||||
} else
|
||||
hwif->set_pio_mode(drive, req_pio);
|
||||
port_ops->set_pio_mode(drive, req_pio);
|
||||
} else {
|
||||
int keep_dma = drive->using_dma;
|
||||
|
||||
|
Reference in New Issue
Block a user