diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-01-06 11:20:56 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-01-06 11:20:56 -0500 |
commit | 2bd24a1cfc99d242c2cff9a6b74ca49fcaac3fb6 (patch) | |
tree | d4797f56699e9da367e12b5e1d01b108241424f6 /drivers/ide/ide-iops.c | |
parent | 5e7f3a46690f7f6c9f2781c700ab4370874aa0e8 (diff) |
ide: add port and host iterators
Add ide_port_for_each_dev() / ide_host_for_each_port() iterators
and update IDE code to use them.
While at it:
- s/unit/i/ variable in ide_port_wait_ready(), ide_probe_port(),
ide_port_tune_devices(), ide_port_init_devices_data(), do_reset1(),
ide_acpi_set_state() and scc_dma_end()
- s/d/i/ variable in ide_proc_port_register_devices()
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r-- | drivers/ide/ide-iops.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 26b58d15c4e6..1a22c31ce7ac 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -1081,8 +1081,9 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi) | |||
1081 | struct ide_io_ports *io_ports = &hwif->io_ports; | 1081 | struct ide_io_ports *io_ports = &hwif->io_ports; |
1082 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; | 1082 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; |
1083 | const struct ide_port_ops *port_ops; | 1083 | const struct ide_port_ops *port_ops; |
1084 | ide_drive_t *tdrive; | ||
1084 | unsigned long flags, timeout; | 1085 | unsigned long flags, timeout; |
1085 | unsigned int unit; | 1086 | int i; |
1086 | DEFINE_WAIT(wait); | 1087 | DEFINE_WAIT(wait); |
1087 | 1088 | ||
1088 | spin_lock_irqsave(&hwif->lock, flags); | 1089 | spin_lock_irqsave(&hwif->lock, flags); |
@@ -1110,9 +1111,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi) | |||
1110 | 1111 | ||
1111 | prepare_to_wait(&ide_park_wq, &wait, TASK_UNINTERRUPTIBLE); | 1112 | prepare_to_wait(&ide_park_wq, &wait, TASK_UNINTERRUPTIBLE); |
1112 | timeout = jiffies; | 1113 | timeout = jiffies; |
1113 | for (unit = 0; unit < MAX_DRIVES; unit++) { | 1114 | ide_port_for_each_dev(i, tdrive, hwif) { |
1114 | ide_drive_t *tdrive = hwif->devices[unit]; | ||
1115 | |||
1116 | if (tdrive->dev_flags & IDE_DFLAG_PRESENT && | 1115 | if (tdrive->dev_flags & IDE_DFLAG_PRESENT && |
1117 | tdrive->dev_flags & IDE_DFLAG_PARKED && | 1116 | tdrive->dev_flags & IDE_DFLAG_PARKED && |
1118 | time_after(tdrive->sleep, timeout)) | 1117 | time_after(tdrive->sleep, timeout)) |
@@ -1133,8 +1132,8 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi) | |||
1133 | * First, reset any device state data we were maintaining | 1132 | * First, reset any device state data we were maintaining |
1134 | * for any of the drives on this interface. | 1133 | * for any of the drives on this interface. |
1135 | */ | 1134 | */ |
1136 | for (unit = 0; unit < MAX_DRIVES; ++unit) | 1135 | ide_port_for_each_dev(i, tdrive, hwif) |
1137 | pre_reset(hwif->devices[unit]); | 1136 | pre_reset(tdrive); |
1138 | 1137 | ||
1139 | if (io_ports->ctl_addr == 0) { | 1138 | if (io_ports->ctl_addr == 0) { |
1140 | spin_unlock_irqrestore(&hwif->lock, flags); | 1139 | spin_unlock_irqrestore(&hwif->lock, flags); |