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/cs5535.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/cs5535.c')
-rw-r--r-- | drivers/ide/pci/cs5535.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c index dd3dc23af995..707d2e182552 100644 --- a/drivers/ide/pci/cs5535.c +++ b/drivers/ide/pci/cs5535.c | |||
@@ -80,12 +80,12 @@ static void cs5535_set_speed(ide_drive_t *drive, const u8 speed) | |||
80 | 80 | ||
81 | /* Set the PIO timings */ | 81 | /* Set the PIO timings */ |
82 | if (speed < XFER_SW_DMA_0) { | 82 | if (speed < XFER_SW_DMA_0) { |
83 | ide_drive_t *pair = ide_get_paired_drive(drive); | 83 | ide_drive_t *pair = ide_get_pair_dev(drive); |
84 | u8 cmd, pioa; | 84 | u8 cmd, pioa; |
85 | 85 | ||
86 | cmd = pioa = speed - XFER_PIO_0; | 86 | cmd = pioa = speed - XFER_PIO_0; |
87 | 87 | ||
88 | if (pair->present) { | 88 | if (pair) { |
89 | u8 piob = ide_get_best_pio_mode(pair, 255, 4); | 89 | u8 piob = ide_get_best_pio_mode(pair, 255, 4); |
90 | 90 | ||
91 | if (piob < cmd) | 91 | if (piob < cmd) |