Commit ebdfca6e authored by Alan Cox's avatar Alan Cox Committed by Jeff Garzik

[PATCH] libata: add ata_dev_pair helper

Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 082776e4
...@@ -1575,6 +1575,23 @@ void sata_phy_reset(struct ata_port *ap) ...@@ -1575,6 +1575,23 @@ void sata_phy_reset(struct ata_port *ap)
ata_bus_reset(ap); ata_bus_reset(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. * ata_port_disable - Disable port.
* @ap: Port to be disabled. * @ap: Port to be disabled.
......
...@@ -573,6 +573,8 @@ extern int ata_std_bios_param(struct scsi_device *sdev, ...@@ -573,6 +573,8 @@ extern int ata_std_bios_param(struct scsi_device *sdev,
struct block_device *bdev, struct block_device *bdev,
sector_t capacity, int geom[]); sector_t capacity, int geom[]);
extern int ata_scsi_slave_config(struct scsi_device *sdev); extern int ata_scsi_slave_config(struct scsi_device *sdev);
extern struct ata_device *ata_dev_pair(struct ata_port *ap,
struct ata_device *adev);
/* /*
* Timing helpers * Timing helpers
......
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