aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:52 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:52 -0400
commitb73c7ee25da6133f97f47ffd3557288417da7c76 (patch)
tree0d348c81294d246b8417aff6e24502c93b312505 /drivers/ide/ide-cd.c
parentc6dfa867bb45f4bff2e48f3bc89ab1d6a7ab4c21 (diff)
ide: add ->read_status method
* Remove ide_read_status() inline helper. * Add ->read_status method for reading ATA Status register and use it instead of ->INB. While at it: * Don't use HWGROUP() macro. 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.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 6e29dd532090..82879a1a89e5 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -280,11 +280,12 @@ static void ide_dump_status_no_sense(ide_drive_t *drive, const char *msg, u8 st)
280 */ 280 */
281static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) 281static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
282{ 282{
283 struct request *rq = HWGROUP(drive)->rq; 283 ide_hwif_t *hwif = drive->hwif;
284 struct request *rq = hwif->hwgroup->rq;
284 int stat, err, sense_key; 285 int stat, err, sense_key;
285 286
286 /* check for errors */ 287 /* check for errors */
287 stat = ide_read_status(drive); 288 stat = hwif->read_status(hwif);
288 289
289 if (stat_ret) 290 if (stat_ret)
290 *stat_ret = stat; 291 *stat_ret = stat;
@@ -606,6 +607,8 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive,
606static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, 607static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
607 int len, int ireason, int rw) 608 int len, int ireason, int rw)
608{ 609{
610 ide_hwif_t *hwif = drive->hwif;
611
609 /* 612 /*
610 * ireason == 0: the drive wants to receive data from us 613 * ireason == 0: the drive wants to receive data from us
611 * ireason == 2: the drive is expecting to transfer data to us 614 * ireason == 2: the drive is expecting to transfer data to us
@@ -624,7 +627,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
624 * Some drives (ASUS) seem to tell us that status info is 627 * Some drives (ASUS) seem to tell us that status info is
625 * available. Just get it and ignore. 628 * available. Just get it and ignore.
626 */ 629 */
627 (void)ide_read_status(drive); 630 (void)hwif->read_status(hwif);
628 return 0; 631 return 0;
629 } else { 632 } else {
630 /* drive wants a command packet, or invalid ireason... */ 633 /* drive wants a command packet, or invalid ireason... */
@@ -1199,8 +1202,9 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
1199 1202
1200 if (blk_fs_request(rq)) { 1203 if (blk_fs_request(rq)) {
1201 if (info->cd_flags & IDE_CD_FLAG_SEEKING) { 1204 if (info->cd_flags & IDE_CD_FLAG_SEEKING) {
1205 ide_hwif_t *hwif = drive->hwif;
1202 unsigned long elapsed = jiffies - info->start_seek; 1206 unsigned long elapsed = jiffies - info->start_seek;
1203 int stat = ide_read_status(drive); 1207 int stat = hwif->read_status(hwif);
1204 1208
1205 if ((stat & SEEK_STAT) != SEEK_STAT) { 1209 if ((stat & SEEK_STAT) != SEEK_STAT) {
1206 if (elapsed < IDECD_SEEK_TIMEOUT) { 1210 if (elapsed < IDECD_SEEK_TIMEOUT) {