Lines Matching refs:hpsa_sas_phy
9420 static struct hpsa_sas_phy *hpsa_alloc_sas_phy( in hpsa_alloc_sas_phy()
9423 struct hpsa_sas_phy *hpsa_sas_phy; in hpsa_alloc_sas_phy() local
9426 hpsa_sas_phy = kzalloc(sizeof(*hpsa_sas_phy), GFP_KERNEL); in hpsa_alloc_sas_phy()
9427 if (!hpsa_sas_phy) in hpsa_alloc_sas_phy()
9433 kfree(hpsa_sas_phy); in hpsa_alloc_sas_phy()
9438 hpsa_sas_phy->phy = phy; in hpsa_alloc_sas_phy()
9439 hpsa_sas_phy->parent_port = hpsa_sas_port; in hpsa_alloc_sas_phy()
9441 return hpsa_sas_phy; in hpsa_alloc_sas_phy()
9444 static void hpsa_free_sas_phy(struct hpsa_sas_phy *hpsa_sas_phy) in hpsa_free_sas_phy() argument
9446 struct sas_phy *phy = hpsa_sas_phy->phy; in hpsa_free_sas_phy()
9448 sas_port_delete_phy(hpsa_sas_phy->parent_port->port, phy); in hpsa_free_sas_phy()
9449 if (hpsa_sas_phy->added_to_port) in hpsa_free_sas_phy()
9450 list_del(&hpsa_sas_phy->phy_list_entry); in hpsa_free_sas_phy()
9452 kfree(hpsa_sas_phy); in hpsa_free_sas_phy()
9455 static int hpsa_sas_port_add_phy(struct hpsa_sas_phy *hpsa_sas_phy) in hpsa_sas_port_add_phy() argument
9462 hpsa_sas_port = hpsa_sas_phy->parent_port; in hpsa_sas_port_add_phy()
9463 phy = hpsa_sas_phy->phy; in hpsa_sas_port_add_phy()
9477 rc = sas_phy_add(hpsa_sas_phy->phy); in hpsa_sas_port_add_phy()
9481 sas_port_add_phy(hpsa_sas_port->port, hpsa_sas_phy->phy); in hpsa_sas_port_add_phy()
9482 list_add_tail(&hpsa_sas_phy->phy_list_entry, in hpsa_sas_port_add_phy()
9484 hpsa_sas_phy->added_to_port = true; in hpsa_sas_port_add_phy()
9543 struct hpsa_sas_phy *hpsa_sas_phy; in hpsa_free_sas_port() local
9544 struct hpsa_sas_phy *next; in hpsa_free_sas_port()
9546 list_for_each_entry_safe(hpsa_sas_phy, next, in hpsa_free_sas_port()
9548 hpsa_free_sas_phy(hpsa_sas_phy); in hpsa_free_sas_port()
9607 struct hpsa_sas_phy *hpsa_sas_phy; in hpsa_add_sas_host() local
9621 hpsa_sas_phy = hpsa_alloc_sas_phy(hpsa_sas_port); in hpsa_add_sas_host()
9622 if (!hpsa_sas_phy) { in hpsa_add_sas_host()
9627 rc = hpsa_sas_port_add_phy(hpsa_sas_phy); in hpsa_add_sas_host()
9636 hpsa_free_sas_phy(hpsa_sas_phy); in hpsa_add_sas_host()