diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:54 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:54 -0400 |
commit | 1823649b5abb77ffe638178bc5253249d3ecd17d (patch) | |
tree | 154d876b89cf010568d18105913c7fbca8d7cba9 /drivers/ide/ide-iops.c | |
parent | 88a72109b2256bf2974f324a8f890b4a06faf7e9 (diff) |
ide: add ide_read_bcount_and_ireason() helper
Add ide_read_bcount_and_ireason() helper and use it instead of ->INB
in {cdrom_newpc,ide_pc}_intr().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r-- | drivers/ide/ide-iops.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 113db8744736..cb11c7861a50 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -405,6 +405,21 @@ u8 ide_read_error(ide_drive_t *drive) | |||
405 | } | 405 | } |
406 | EXPORT_SYMBOL_GPL(ide_read_error); | 406 | EXPORT_SYMBOL_GPL(ide_read_error); |
407 | 407 | ||
408 | void ide_read_bcount_and_ireason(ide_drive_t *drive, u16 *bcount, u8 *ireason) | ||
409 | { | ||
410 | ide_task_t task; | ||
411 | |||
412 | memset(&task, 0, sizeof(task)); | ||
413 | task.tf_flags = IDE_TFLAG_IN_LBAH | IDE_TFLAG_IN_LBAM | | ||
414 | IDE_TFLAG_IN_NSECT; | ||
415 | |||
416 | drive->hwif->tf_read(drive, &task); | ||
417 | |||
418 | *bcount = (task.tf.lbah << 8) | task.tf.lbam; | ||
419 | *ireason = task.tf.nsect & 3; | ||
420 | } | ||
421 | EXPORT_SYMBOL_GPL(ide_read_bcount_and_ireason); | ||
422 | |||
408 | void ide_fix_driveid (struct hd_driveid *id) | 423 | void ide_fix_driveid (struct hd_driveid *id) |
409 | { | 424 | { |
410 | #ifndef __LITTLE_ENDIAN | 425 | #ifndef __LITTLE_ENDIAN |