aboutsummaryrefslogtreecommitdiff
path: root/drivers/ide/pci/cs5530.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 22:39:26 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 22:39:26 +0200
commit7e59ea21aab1a91ca31bc64c7d3035ebdbd336d1 (patch)
tree6cdbc937687dbba316f22e2b68cb036511fce951 /drivers/ide/pci/cs5530.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/cs5530.c')
-rw-r--r--drivers/ide/pci/cs5530.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index ef91e9d7c54..804ecabbd65 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -81,11 +81,11 @@ static void cs5530_set_pio_mode(ide_drive_t *drive, const u8 pio)
static u8 cs5530_udma_filter(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
- ide_drive_t *mate = &hwif->drives[(drive->dn & 1) ^ 1];
+ ide_drive_t *mate = ide_get_pair_dev(drive);
u16 *mateid = mate->id;
u8 mask = hwif->ultra_mask;
- if (mate->present == 0)
+ if (mate == NULL)
goto out;
if (ata_id_has_dma(mateid) && __ide_dma_bad_drive(mate) == 0) {