提交 1b678347 编写于 作者: B Benjamin Herrenschmidt 提交者: 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: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>
Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册