diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:26 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:26 -0400 |
commit | 7e59ea21aab1a91ca31bc64c7d3035ebdbd336d1 (patch) | |
tree | 6cdbc937687dbba316f22e2b68cb036511fce951 /drivers/ide/pci/opti621.c | |
parent | 2a924662b646fa25cb491d50aa1202a94aa4ac55 (diff) |
ide: check drive->present in ide_get_paired_drive()
* Change ide_get_paired_drive() to return NULL if peer device
is not present and update all users accordingly.
While at it:
* ide_get_paired_drive() -> ide_get_pair_dev()
* Use ide_get_pair_dev() in cs5530.c, sc1200.c and via82cxxx.c.
There should be no functional changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/opti621.c')
-rw-r--r-- | drivers/ide/pci/opti621.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c index e28e672ddafc..e913da479808 100644 --- a/drivers/ide/pci/opti621.c +++ b/drivers/ide/pci/opti621.c | |||
@@ -137,7 +137,7 @@ static u8 read_reg(int reg) | |||
137 | static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) | 137 | static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) |
138 | { | 138 | { |
139 | ide_hwif_t *hwif = drive->hwif; | 139 | ide_hwif_t *hwif = drive->hwif; |
140 | ide_drive_t *pair = ide_get_paired_drive(drive); | 140 | ide_drive_t *pair = ide_get_pair_dev(drive); |
141 | unsigned long flags; | 141 | unsigned long flags; |
142 | u8 tim, misc, addr_pio = pio, clk; | 142 | u8 tim, misc, addr_pio = pio, clk; |
143 | 143 | ||
@@ -153,7 +153,7 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
153 | 153 | ||
154 | drive->drive_data = XFER_PIO_0 + pio; | 154 | drive->drive_data = XFER_PIO_0 + pio; |
155 | 155 | ||
156 | if (pair->present) { | 156 | if (pair) { |
157 | if (pair->drive_data && pair->drive_data < drive->drive_data) | 157 | if (pair->drive_data && pair->drive_data < drive->drive_data) |
158 | addr_pio = pair->drive_data - XFER_PIO_0; | 158 | addr_pio = pair->drive_data - XFER_PIO_0; |
159 | } | 159 | } |