diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:56 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:56 -0400 |
commit | 374e042c3e767ac2e5a40b78529220e0b3de793c (patch) | |
tree | 433d258f6da9783f0cb34234af9c359353f531fe /drivers/ide/ide-cd.c | |
parent | d6276b5f5cc7508124de291f3ed59c6945c17ae7 (diff) |
ide: add struct ide_tp_ops (take 2)
* Add struct ide_tp_ops for transport methods.
* Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info
and ide_hwif_t.
* Set the default hwif->tp_ops in ide_init_port_data().
* Set host driver specific hwif->tp_ops in ide_init_port().
* Export ide_exec_command(), ide_read_status(), ide_read_altstatus(),
ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}()
and ata_{in,out}put_data().
* Convert host drivers and core code to use struct ide_tp_ops.
* Remove no longer needed default_hwif_transport().
* Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops.
While at it:
* Use struct ide_port_info in falconide.c and q40ide.c.
* Rename ata_{in,out}put_data() to ide_{in,out}put_data().
v2:
* Fix missing convertion in ns87415.c.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 563a380d0e7a..d9798ca433ba 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -285,7 +285,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
285 | int stat, err, sense_key; | 285 | int stat, err, sense_key; |
286 | 286 | ||
287 | /* check for errors */ | 287 | /* check for errors */ |
288 | stat = hwif->read_status(hwif); | 288 | stat = hwif->tp_ops->read_status(hwif); |
289 | 289 | ||
290 | if (stat_ret) | 290 | if (stat_ret) |
291 | *stat_ret = stat; | 291 | *stat_ret = stat; |
@@ -590,7 +590,7 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive, | |||
590 | cmd_len = ATAPI_MIN_CDB_BYTES; | 590 | cmd_len = ATAPI_MIN_CDB_BYTES; |
591 | 591 | ||
592 | /* send the command to the device */ | 592 | /* send the command to the device */ |
593 | hwif->output_data(drive, NULL, rq->cmd, cmd_len); | 593 | hwif->tp_ops->output_data(drive, NULL, rq->cmd, cmd_len); |
594 | 594 | ||
595 | /* start the DMA if need be */ | 595 | /* start the DMA if need be */ |
596 | if (info->dma) | 596 | if (info->dma) |
@@ -627,7 +627,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, | |||
627 | * Some drives (ASUS) seem to tell us that status info is | 627 | * Some drives (ASUS) seem to tell us that status info is |
628 | * available. Just get it and ignore. | 628 | * available. Just get it and ignore. |
629 | */ | 629 | */ |
630 | (void)hwif->read_status(hwif); | 630 | (void)hwif->tp_ops->read_status(hwif); |
631 | return 0; | 631 | return 0; |
632 | } else { | 632 | } else { |
633 | /* drive wants a command packet, or invalid ireason... */ | 633 | /* drive wants a command packet, or invalid ireason... */ |
@@ -990,10 +990,10 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
990 | 990 | ||
991 | if (ireason == 0) { | 991 | if (ireason == 0) { |
992 | write = 1; | 992 | write = 1; |
993 | xferfunc = hwif->output_data; | 993 | xferfunc = hwif->tp_ops->output_data; |
994 | } else { | 994 | } else { |
995 | write = 0; | 995 | write = 0; |
996 | xferfunc = hwif->input_data; | 996 | xferfunc = hwif->tp_ops->input_data; |
997 | } | 997 | } |
998 | 998 | ||
999 | /* transfer data */ | 999 | /* transfer data */ |
@@ -1200,7 +1200,7 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
1200 | if (info->cd_flags & IDE_CD_FLAG_SEEKING) { | 1200 | if (info->cd_flags & IDE_CD_FLAG_SEEKING) { |
1201 | ide_hwif_t *hwif = drive->hwif; | 1201 | ide_hwif_t *hwif = drive->hwif; |
1202 | unsigned long elapsed = jiffies - info->start_seek; | 1202 | unsigned long elapsed = jiffies - info->start_seek; |
1203 | int stat = hwif->read_status(hwif); | 1203 | int stat = hwif->tp_ops->read_status(hwif); |
1204 | 1204 | ||
1205 | if ((stat & SEEK_STAT) != SEEK_STAT) { | 1205 | if ((stat & SEEK_STAT) != SEEK_STAT) { |
1206 | if (elapsed < IDECD_SEEK_TIMEOUT) { | 1206 | if (elapsed < IDECD_SEEK_TIMEOUT) { |