Skip to content

Commit 888ea1b

Browse files
Xingui Yangmartinkpetersen
authored andcommitted
scsi: libsas: Add helper for port add ex_phy
This moves the process of adding ex_phy to a port into a new helper. Signed-off-by: Xingui Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 4cece76 commit 888ea1b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/scsi/libsas/sas_expander.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ static int sas_configure_phy(struct domain_device *dev, int phy_id,
2626
u8 *sas_addr, int include);
2727
static int sas_disable_routing(struct domain_device *dev, u8 *sas_addr);
2828

29+
static void sas_port_add_ex_phy(struct sas_port *port, struct ex_phy *ex_phy)
30+
{
31+
sas_port_add_phy(port, ex_phy->phy);
32+
ex_phy->port = port;
33+
ex_phy->phy_state = PHY_DEVICE_DISCOVERED;
34+
}
35+
2936
/* ---------- SMP task management ---------- */
3037

3138
/* Give it some long enough timeout. In seconds. */
@@ -857,9 +864,7 @@ static bool sas_ex_join_wide_port(struct domain_device *parent, int phy_id)
857864

858865
if (!memcmp(phy->attached_sas_addr, ephy->attached_sas_addr,
859866
SAS_ADDR_SIZE) && ephy->port) {
860-
sas_port_add_phy(ephy->port, phy->phy);
861-
phy->port = ephy->port;
862-
phy->phy_state = PHY_DEVICE_DISCOVERED;
867+
sas_port_add_ex_phy(ephy->port, phy);
863868
return true;
864869
}
865870
}

0 commit comments

Comments
 (0)