aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libata-core.c17
-rw-r--r--include/linux/libata.h2
2 files changed, 19 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)
1576} 1576}
1577 1577
1578/** 1578/**
1579 * ata_dev_pair - return other device on cable
1580 * @ap: port
1581 * @adev: device
1582 *
1583 * Obtain the other device on the same cable, or if none is
1584 * present NULL is returned
1585 */
1586
1587struct ata_device *ata_dev_pair(struct ata_port *ap, struct ata_device *adev)
1588{
1589 struct ata_device *pair = &ap->device[1 - adev->devno];
1590 if (!ata_dev_present(pair))
1591 return NULL;
1592 return pair;
1593}
1594
1595/**
1579 * ata_port_disable - Disable port. 1596 * ata_port_disable - Disable port.
1580 * @ap: Port to be disabled. 1597 * @ap: Port to be disabled.
1581 * 1598 *
diff --git a/include/linux/libata.h b/include/linux/libata.h
index c52f13498556..80c2339da67d 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -573,6 +573,8 @@ extern int ata_std_bios_param(struct scsi_device *sdev,
573 struct block_device *bdev, 573 struct block_device *bdev,
574 sector_t capacity, int geom[]); 574 sector_t capacity, int geom[]);
575extern int ata_scsi_slave_config(struct scsi_device *sdev); 575extern int ata_scsi_slave_config(struct scsi_device *sdev);
576extern struct ata_device *ata_dev_pair(struct ata_port *ap,
577 struct ata_device *adev);
576 578
577/* 579/*
578 * Timing helpers 580 * Timing helpers