diff options
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r-- | drivers/ide/ide-atapi.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index a359323d8ffe..7201b176d75b 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -254,15 +254,13 @@ EXPORT_SYMBOL_GPL(ide_cd_get_xferlen); | |||
254 | 254 | ||
255 | void ide_read_bcount_and_ireason(ide_drive_t *drive, u16 *bcount, u8 *ireason) | 255 | void ide_read_bcount_and_ireason(ide_drive_t *drive, u16 *bcount, u8 *ireason) |
256 | { | 256 | { |
257 | struct ide_cmd cmd; | 257 | struct ide_taskfile tf; |
258 | 258 | ||
259 | memset(&cmd, 0, sizeof(cmd)); | 259 | drive->hwif->tp_ops->tf_read(drive, &tf, IDE_VALID_NSECT | |
260 | cmd.valid.in.tf = IDE_VALID_LBAH | IDE_VALID_LBAM | IDE_VALID_NSECT; | 260 | IDE_VALID_LBAM | IDE_VALID_LBAH); |
261 | 261 | ||
262 | drive->hwif->tp_ops->tf_read(drive, &cmd); | 262 | *bcount = (tf.lbah << 8) | tf.lbam; |
263 | 263 | *ireason = tf.nsect & 3; | |
264 | *bcount = (cmd.tf.lbah << 8) | cmd.tf.lbam; | ||
265 | *ireason = cmd.tf.nsect & 3; | ||
266 | } | 264 | } |
267 | EXPORT_SYMBOL_GPL(ide_read_bcount_and_ireason); | 265 | EXPORT_SYMBOL_GPL(ide_read_bcount_and_ireason); |
268 | 266 | ||
@@ -452,14 +450,11 @@ static void ide_init_packet_cmd(struct ide_cmd *cmd, u8 valid_tf, | |||
452 | 450 | ||
453 | static u8 ide_read_ireason(ide_drive_t *drive) | 451 | static u8 ide_read_ireason(ide_drive_t *drive) |
454 | { | 452 | { |
455 | struct ide_cmd cmd; | 453 | struct ide_taskfile tf; |
456 | |||
457 | memset(&cmd, 0, sizeof(cmd)); | ||
458 | cmd.valid.in.tf = IDE_VALID_NSECT; | ||
459 | 454 | ||
460 | drive->hwif->tp_ops->tf_read(drive, &cmd); | 455 | drive->hwif->tp_ops->tf_read(drive, &tf, IDE_VALID_NSECT); |
461 | 456 | ||
462 | return cmd.tf.nsect & 3; | 457 | return tf.nsect & 3; |
463 | } | 458 | } |
464 | 459 | ||
465 | static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason) | 460 | static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason) |