Lines Matching refs:hpsa_sas_phy
9551 static struct hpsa_sas_phy *hpsa_alloc_sas_phy(
9554 struct hpsa_sas_phy *hpsa_sas_phy;
9557 hpsa_sas_phy = kzalloc(sizeof(*hpsa_sas_phy), GFP_KERNEL);
9558 if (!hpsa_sas_phy)
9564 kfree(hpsa_sas_phy);
9569 hpsa_sas_phy->phy = phy;
9570 hpsa_sas_phy->parent_port = hpsa_sas_port;
9572 return hpsa_sas_phy;
9575 static void hpsa_free_sas_phy(struct hpsa_sas_phy *hpsa_sas_phy)
9577 struct sas_phy *phy = hpsa_sas_phy->phy;
9579 sas_port_delete_phy(hpsa_sas_phy->parent_port->port, phy);
9580 if (hpsa_sas_phy->added_to_port)
9581 list_del(&hpsa_sas_phy->phy_list_entry);
9583 kfree(hpsa_sas_phy);
9586 static int hpsa_sas_port_add_phy(struct hpsa_sas_phy *hpsa_sas_phy)
9593 hpsa_sas_port = hpsa_sas_phy->parent_port;
9594 phy = hpsa_sas_phy->phy;
9608 rc = sas_phy_add(hpsa_sas_phy->phy);
9612 sas_port_add_phy(hpsa_sas_port->port, hpsa_sas_phy->phy);
9613 list_add_tail(&hpsa_sas_phy->phy_list_entry,
9615 hpsa_sas_phy->added_to_port = true;
9674 struct hpsa_sas_phy *hpsa_sas_phy;
9675 struct hpsa_sas_phy *next;
9677 list_for_each_entry_safe(hpsa_sas_phy, next,
9679 hpsa_free_sas_phy(hpsa_sas_phy);
9738 struct hpsa_sas_phy *hpsa_sas_phy;
9752 hpsa_sas_phy = hpsa_alloc_sas_phy(hpsa_sas_port);
9753 if (!hpsa_sas_phy) {
9758 rc = hpsa_sas_port_add_phy(hpsa_sas_phy);
9767 sas_phy_free(hpsa_sas_phy->phy);
9768 kfree(hpsa_sas_phy);