diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2008-07-16 14:33:45 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-16 14:33:45 -0400 |
commit | ae8789f034ffa077105575817ec0cc581fd18d83 (patch) | |
tree | b75782df0c1dd2aa04fa1cd241265c671b3cad73 /drivers/ide | |
parent | af6765ce9f535f20e6f9975269660fe49594745a (diff) |
ide-cd: remove ide_cd_drain_data and ide_cd_pad_transfer
Use the generic ide_pad_transfer() helper instead.
[bart: fixup ide_cd_drain_data() -> ide_pad_transfer() conversion]
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-cd.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index eb4b27548caf..789b19cf5e55 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -599,28 +599,6 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive, | |||
599 | } | 599 | } |
600 | 600 | ||
601 | /* | 601 | /* |
602 | * Block read functions. | ||
603 | */ | ||
604 | static void ide_cd_pad_transfer(ide_drive_t *drive, xfer_func_t *xf, int len) | ||
605 | { | ||
606 | while (len > 0) { | ||
607 | int dum = 0; | ||
608 | xf(drive, NULL, &dum, sizeof(dum)); | ||
609 | len -= sizeof(dum); | ||
610 | } | ||
611 | } | ||
612 | |||
613 | static void ide_cd_drain_data(ide_drive_t *drive, int nsects) | ||
614 | { | ||
615 | while (nsects > 0) { | ||
616 | static char dum[SECTOR_SIZE]; | ||
617 | |||
618 | drive->hwif->input_data(drive, NULL, dum, sizeof(dum)); | ||
619 | nsects--; | ||
620 | } | ||
621 | } | ||
622 | |||
623 | /* | ||
624 | * Check the contents of the interrupt reason register from the cdrom | 602 | * Check the contents of the interrupt reason register from the cdrom |
625 | * and attempt to recover if there are problems. Returns 0 if everything's | 603 | * and attempt to recover if there are problems. Returns 0 if everything's |
626 | * ok; nonzero if the request has been terminated. | 604 | * ok; nonzero if the request has been terminated. |
@@ -635,15 +613,12 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, | |||
635 | if (ireason == (!rw << 1)) | 613 | if (ireason == (!rw << 1)) |
636 | return 0; | 614 | return 0; |
637 | else if (ireason == (rw << 1)) { | 615 | else if (ireason == (rw << 1)) { |
638 | ide_hwif_t *hwif = drive->hwif; | ||
639 | xfer_func_t *xf; | ||
640 | 616 | ||
641 | /* whoops... */ | 617 | /* whoops... */ |
642 | printk(KERN_ERR "%s: %s: wrong transfer direction!\n", | 618 | printk(KERN_ERR "%s: %s: wrong transfer direction!\n", |
643 | drive->name, __func__); | 619 | drive->name, __func__); |
644 | 620 | ||
645 | xf = rw ? hwif->output_data : hwif->input_data; | 621 | ide_pad_transfer(drive, rw, len); |
646 | ide_cd_pad_transfer(drive, xf, len); | ||
647 | } else if (rw == 0 && ireason == 1) { | 622 | } else if (rw == 0 && ireason == 1) { |
648 | /* | 623 | /* |
649 | * Some drives (ASUS) seem to tell us that status info is | 624 | * Some drives (ASUS) seem to tell us that status info is |
@@ -1006,7 +981,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
1006 | - bio_cur_sectors(rq->bio), | 981 | - bio_cur_sectors(rq->bio), |
1007 | thislen >> 9); | 982 | thislen >> 9); |
1008 | if (nskip > 0) { | 983 | if (nskip > 0) { |
1009 | ide_cd_drain_data(drive, nskip); | 984 | ide_pad_transfer(drive, write, nskip << 9); |
1010 | rq->current_nr_sectors -= nskip; | 985 | rq->current_nr_sectors -= nskip; |
1011 | thislen -= (nskip << 9); | 986 | thislen -= (nskip << 9); |
1012 | } | 987 | } |
@@ -1043,7 +1018,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
1043 | * If the buffers are full, pipe the rest into | 1018 | * If the buffers are full, pipe the rest into |
1044 | * oblivion. | 1019 | * oblivion. |
1045 | */ | 1020 | */ |
1046 | ide_cd_drain_data(drive, thislen >> 9); | 1021 | ide_pad_transfer(drive, 0, thislen); |
1047 | else { | 1022 | else { |
1048 | printk(KERN_ERR "%s: confused, missing data\n", | 1023 | printk(KERN_ERR "%s: confused, missing data\n", |
1049 | drive->name); | 1024 | drive->name); |
@@ -1091,7 +1066,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
1091 | 1066 | ||
1092 | /* pad, if necessary */ | 1067 | /* pad, if necessary */ |
1093 | if (!blk_fs_request(rq) && len > 0) | 1068 | if (!blk_fs_request(rq) && len > 0) |
1094 | ide_cd_pad_transfer(drive, xferfunc, len); | 1069 | ide_pad_transfer(drive, write, len); |
1095 | 1070 | ||
1096 | if (blk_pc_request(rq)) { | 1071 | if (blk_pc_request(rq)) { |
1097 | timeout = rq->timeout; | 1072 | timeout = rq->timeout; |