aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/scsi_transport_sas.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 6da6721eb0db..1fe6b2d01853 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -748,6 +748,18 @@ static void sas_end_device_release(struct device *dev)
748} 748}
749 749
750/** 750/**
751 * sas_rphy_initialize - common rphy intialization
752 * @rphy: rphy to initialise
753 *
754 * Used by both sas_end_device_alloc() and sas_expander_alloc() to
755 * initialise the common rphy component of each.
756 */
757static void sas_rphy_initialize(struct sas_rphy *rphy)
758{
759 INIT_LIST_HEAD(&rphy->list);
760}
761
762/**
751 * sas_end_device_alloc - allocate an rphy for an end device 763 * sas_end_device_alloc - allocate an rphy for an end device
752 * 764 *
753 * Allocates an SAS remote PHY structure, connected to @parent. 765 * Allocates an SAS remote PHY structure, connected to @parent.
@@ -771,6 +783,7 @@ struct sas_rphy *sas_end_device_alloc(struct sas_phy *parent)
771 sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d-%d", 783 sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d-%d",
772 shost->host_no, parent->port_identifier, parent->number); 784 shost->host_no, parent->port_identifier, parent->number);
773 rdev->rphy.identify.device_type = SAS_END_DEVICE; 785 rdev->rphy.identify.device_type = SAS_END_DEVICE;
786 sas_rphy_initialize(&rdev->rphy);
774 transport_setup_device(&rdev->rphy.dev); 787 transport_setup_device(&rdev->rphy.dev);
775 788
776 return &rdev->rphy; 789 return &rdev->rphy;
@@ -809,6 +822,7 @@ struct sas_rphy *sas_expander_alloc(struct sas_phy *parent,
809 sprintf(rdev->rphy.dev.bus_id, "expander-%d:%d", 822 sprintf(rdev->rphy.dev.bus_id, "expander-%d:%d",
810 shost->host_no, rdev->rphy.scsi_target_id); 823 shost->host_no, rdev->rphy.scsi_target_id);
811 rdev->rphy.identify.device_type = type; 824 rdev->rphy.identify.device_type = type;
825 sas_rphy_initialize(&rdev->rphy);
812 transport_setup_device(&rdev->rphy.dev); 826 transport_setup_device(&rdev->rphy.dev);
813 827
814 return &rdev->rphy; 828 return &rdev->rphy;