Lines Matching refs:hpsa_sas_phy
9228 static struct hpsa_sas_phy *hpsa_alloc_sas_phy( in hpsa_alloc_sas_phy()
9231 struct hpsa_sas_phy *hpsa_sas_phy; in hpsa_alloc_sas_phy() local
9234 hpsa_sas_phy = kzalloc(sizeof(*hpsa_sas_phy), GFP_KERNEL); in hpsa_alloc_sas_phy()
9235 if (!hpsa_sas_phy) in hpsa_alloc_sas_phy()
9241 kfree(hpsa_sas_phy); in hpsa_alloc_sas_phy()
9246 hpsa_sas_phy->phy = phy; in hpsa_alloc_sas_phy()
9247 hpsa_sas_phy->parent_port = hpsa_sas_port; in hpsa_alloc_sas_phy()
9249 return hpsa_sas_phy; in hpsa_alloc_sas_phy()
9252 static void hpsa_free_sas_phy(struct hpsa_sas_phy *hpsa_sas_phy) in hpsa_free_sas_phy() argument
9254 struct sas_phy *phy = hpsa_sas_phy->phy; in hpsa_free_sas_phy()
9256 sas_port_delete_phy(hpsa_sas_phy->parent_port->port, phy); in hpsa_free_sas_phy()
9258 if (hpsa_sas_phy->added_to_port) in hpsa_free_sas_phy()
9259 list_del(&hpsa_sas_phy->phy_list_entry); in hpsa_free_sas_phy()
9260 kfree(hpsa_sas_phy); in hpsa_free_sas_phy()
9263 static int hpsa_sas_port_add_phy(struct hpsa_sas_phy *hpsa_sas_phy) in hpsa_sas_port_add_phy() argument
9270 hpsa_sas_port = hpsa_sas_phy->parent_port; in hpsa_sas_port_add_phy()
9271 phy = hpsa_sas_phy->phy; in hpsa_sas_port_add_phy()
9285 rc = sas_phy_add(hpsa_sas_phy->phy); in hpsa_sas_port_add_phy()
9289 sas_port_add_phy(hpsa_sas_port->port, hpsa_sas_phy->phy); in hpsa_sas_port_add_phy()
9290 list_add_tail(&hpsa_sas_phy->phy_list_entry, in hpsa_sas_port_add_phy()
9292 hpsa_sas_phy->added_to_port = true; in hpsa_sas_port_add_phy()
9351 struct hpsa_sas_phy *hpsa_sas_phy; in hpsa_free_sas_port() local
9352 struct hpsa_sas_phy *next; in hpsa_free_sas_port()
9354 list_for_each_entry_safe(hpsa_sas_phy, next, in hpsa_free_sas_port()
9356 hpsa_free_sas_phy(hpsa_sas_phy); in hpsa_free_sas_port()
9415 struct hpsa_sas_phy *hpsa_sas_phy; in hpsa_add_sas_host() local
9429 hpsa_sas_phy = hpsa_alloc_sas_phy(hpsa_sas_port); in hpsa_add_sas_host()
9430 if (!hpsa_sas_phy) { in hpsa_add_sas_host()
9435 rc = hpsa_sas_port_add_phy(hpsa_sas_phy); in hpsa_add_sas_host()
9444 hpsa_free_sas_phy(hpsa_sas_phy); in hpsa_add_sas_host()