diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-03-23 16:38:34 +0100 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-24 15:52:32 +0100 |
commit | ebdfca6eb1b755d3bfe9a81339ecdafd92038c1a (patch) | |
tree | 1780c1d10756c1f6c3cd34ac2f23faa729d9877d /drivers/scsi | |
parent | [PATCH] Make libata not powerdown drivers on PM_EVENT_FREEZE. (diff) | |
download | linux-ebdfca6eb1b755d3bfe9a81339ecdafd92038c1a.tar.xz linux-ebdfca6eb1b755d3bfe9a81339ecdafd92038c1a.zip |
[PATCH] libata: add ata_dev_pair helper
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libata-core.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index d8f77f2a5af1..909568f7a72a 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -1576,6 +1576,23 @@ void sata_phy_reset(struct ata_port *ap) } /** + * ata_dev_pair - return other device on cable + * @ap: port + * @adev: device + * + * Obtain the other device on the same cable, or if none is + * present NULL is returned + */ + +struct ata_device *ata_dev_pair(struct ata_port *ap, struct ata_device *adev) +{ + struct ata_device *pair = &ap->device[1 - adev->devno]; + if (!ata_dev_present(pair)) + return NULL; + return pair; +} + +/** * ata_port_disable - Disable port. * @ap: Port to be disabled. * |