Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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 */