Skip to content

Commit

Permalink
ide: Add ide_get_paired_drive() helper
Browse files Browse the repository at this point in the history
This adds a helper to get to the "other" drive on a pair connected
to a given hwif.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Benjamin Herrenschmidt authored and Bartlomiej Zolnierkiewicz committed Oct 18, 2007
1 parent d85714d commit 1b67834
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1454,4 +1454,11 @@ static inline int hwif_to_node(ide_hwif_t *hwif)
return dev ? pcibus_to_node(dev->bus) : -1;
}

static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);

return &hwif->drives[(drive->dn ^ 1) & 1];
}

#endif /* _IDE_H */

0 comments on commit 1b67834

Please sign in to comment.