aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/siimage.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:26 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:26 -0400
commit7e59ea21aab1a91ca31bc64c7d3035ebdbd336d1 (patch)
tree6cdbc937687dbba316f22e2b68cb036511fce951 /drivers/ide/pci/siimage.c
parent2a924662b646fa25cb491d50aa1202a94aa4ac55 (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/siimage.c')
-rw-r--r--drivers/ide/pci/siimage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 7b5bd8729f64..83c36e6035fa 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -245,7 +245,7 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio)
245 245
246 ide_hwif_t *hwif = HWIF(drive); 246 ide_hwif_t *hwif = HWIF(drive);
247 struct pci_dev *dev = to_pci_dev(hwif->dev); 247 struct pci_dev *dev = to_pci_dev(hwif->dev);
248 ide_drive_t *pair = ide_get_paired_drive(drive); 248 ide_drive_t *pair = ide_get_pair_dev(drive);
249 u32 speedt = 0; 249 u32 speedt = 0;
250 u16 speedp = 0; 250 u16 speedp = 0;
251 unsigned long addr = siimage_seldev(drive, 0x04); 251 unsigned long addr = siimage_seldev(drive, 0x04);
@@ -259,7 +259,7 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio)
259 u8 unit = drive->select.b.unit; 259 u8 unit = drive->select.b.unit;
260 260
261 /* trim *taskfile* PIO to the slowest of the master/slave */ 261 /* trim *taskfile* PIO to the slowest of the master/slave */
262 if (pair->present) { 262 if (pair) {
263 u8 pair_pio = ide_get_best_pio_mode(pair, 255, 4); 263 u8 pair_pio = ide_get_best_pio_mode(pair, 255, 4);
264 264
265 if (pair_pio < tf_pio) 265 if (pair_pio < tf_pio)