From 4109d19af73826aa6fee1a1b951670381be88f8b Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Wed, 8 Apr 2009 14:13:02 +0200 Subject: ide: move common code out of tf_load() method Move device register masking (and setting drive->select) out of tf_load() method and into the only function that needs to use this code, do_rw_taskfile()... Signed-off-by: Sergei Shtylyov [bart: fix whitespace error] Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-taskfile.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/ide/ide-taskfile.c') diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 3160be494aa..0318a4cb09d 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -88,6 +88,16 @@ ide_startstop_t do_rw_taskfile(ide_drive_t *drive, struct ide_cmd *orig_cmd) tp_ops->output_data(drive, cmd, data, 2); } + + if (cmd->valid.out.tf & IDE_VALID_DEVICE) { + u8 HIHI = (cmd->tf_flags & IDE_TFLAG_LBA48) ? + 0xE0 : 0xEF; + + if (!(cmd->ftf_flags & IDE_FTFLAG_FLAGGED)) + cmd->tf.device &= HIHI; + cmd->tf.device |= drive->select; + } + tp_ops->tf_load(drive, cmd); } -- cgit v1.2.3