Commit 1b678347 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Bartlomiej Zolnierkiewicz

ide: Add ide_get_paired_drive() helper

This adds a helper to get to the "other" drive on a pair connected
to a given hwif.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>
Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent d85714d8
......@@ -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 */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment