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 /include/linux/ide.h | |
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 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index a9206c463d7d..1d9716a95dc4 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1450,10 +1450,10 @@ static inline int hwif_to_node(ide_hwif_t *hwif) | |||
1450 | return hwif->dev ? dev_to_node(hwif->dev) : -1; | 1450 | return hwif->dev ? dev_to_node(hwif->dev) : -1; |
1451 | } | 1451 | } |
1452 | 1452 | ||
1453 | static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) | 1453 | static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) |
1454 | { | 1454 | { |
1455 | ide_hwif_t *hwif = HWIF(drive); | 1455 | ide_drive_t *peer = &drive->hwif->drives[(drive->dn ^ 1) & 1]; |
1456 | 1456 | ||
1457 | return &hwif->drives[(drive->dn ^ 1) & 1]; | 1457 | return peer->present ? peer : NULL; |
1458 | } | 1458 | } |
1459 | #endif /* _IDE_H */ | 1459 | #endif /* _IDE_H */ |