diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-03-31 14:15:32 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:32 -0400 |
commit | abb596b25edac1ec1acc4ef53df190771661c3d2 (patch) | |
tree | d20ea24960358ce03e0f27eefd2e6911afd1309c /drivers/ide/ide-io-std.c | |
parent | 0f861e8c47ede537a8ad280c61d5d00d541f04db (diff) |
ide: turn selectproc() method into dev_select() method (take 5)
Turn selectproc() method into dev_select() method by teaching it to write to the
device register and moving it from 'struct ide_port_ops' to 'struct ide_tp_ops'.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: benh@kernel.crashing.org
Cc: petkovbb@gmail.com
[bart: add ->dev_select to at91_ide.c and tx4939.c (__BIG_ENDIAN case)]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io-std.c')
-rw-r--r-- | drivers/ide/ide-io-std.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/ide/ide-io-std.c b/drivers/ide/ide-io-std.c index 7f77bb7db488..9cac281d82c4 100644 --- a/drivers/ide/ide-io-std.c +++ b/drivers/ide/ide-io-std.c | |||
@@ -73,6 +73,18 @@ void ide_write_devctl(ide_hwif_t *hwif, u8 ctl) | |||
73 | } | 73 | } |
74 | EXPORT_SYMBOL_GPL(ide_write_devctl); | 74 | EXPORT_SYMBOL_GPL(ide_write_devctl); |
75 | 75 | ||
76 | void ide_dev_select(ide_drive_t *drive) | ||
77 | { | ||
78 | ide_hwif_t *hwif = drive->hwif; | ||
79 | u8 select = drive->select | ATA_DEVICE_OBS; | ||
80 | |||
81 | if (hwif->host_flags & IDE_HFLAG_MMIO) | ||
82 | writeb(select, (void __iomem *)hwif->io_ports.device_addr); | ||
83 | else | ||
84 | outb(select, hwif->io_ports.device_addr); | ||
85 | } | ||
86 | EXPORT_SYMBOL_GPL(ide_dev_select); | ||
87 | |||
76 | void ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | 88 | void ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) |
77 | { | 89 | { |
78 | ide_hwif_t *hwif = drive->hwif; | 90 | ide_hwif_t *hwif = drive->hwif; |
@@ -280,6 +292,7 @@ const struct ide_tp_ops default_tp_ops = { | |||
280 | .read_altstatus = ide_read_altstatus, | 292 | .read_altstatus = ide_read_altstatus, |
281 | .write_devctl = ide_write_devctl, | 293 | .write_devctl = ide_write_devctl, |
282 | 294 | ||
295 | .dev_select = ide_dev_select, | ||
283 | .tf_load = ide_tf_load, | 296 | .tf_load = ide_tf_load, |
284 | .tf_read = ide_tf_read, | 297 | .tf_read = ide_tf_read, |
285 | 298 | ||