Lines Matching refs:hpsa_sas_phy
9566 static struct hpsa_sas_phy *hpsa_alloc_sas_phy(
9569 struct hpsa_sas_phy *hpsa_sas_phy;
9572 hpsa_sas_phy = kzalloc(sizeof(*hpsa_sas_phy), GFP_KERNEL);
9573 if (!hpsa_sas_phy)
9579 kfree(hpsa_sas_phy);
9584 hpsa_sas_phy->phy = phy;
9585 hpsa_sas_phy->parent_port = hpsa_sas_port;
9587 return hpsa_sas_phy;
9590 static void hpsa_free_sas_phy(struct hpsa_sas_phy *hpsa_sas_phy)
9592 struct sas_phy *phy = hpsa_sas_phy->phy;
9594 sas_port_delete_phy(hpsa_sas_phy->parent_port->port, phy);
9595 if (hpsa_sas_phy->added_to_port)
9596 list_del(&hpsa_sas_phy->phy_list_entry);
9598 kfree(hpsa_sas_phy);
9601 static int hpsa_sas_port_add_phy(struct hpsa_sas_phy *hpsa_sas_phy)
9608 hpsa_sas_port = hpsa_sas_phy->parent_port;
9609 phy = hpsa_sas_phy->phy;
9623 rc = sas_phy_add(hpsa_sas_phy->phy);
9627 sas_port_add_phy(hpsa_sas_port->port, hpsa_sas_phy->phy);
9628 list_add_tail(&hpsa_sas_phy->phy_list_entry,
9630 hpsa_sas_phy->added_to_port = true;
9689 struct hpsa_sas_phy *hpsa_sas_phy;
9690 struct hpsa_sas_phy *next;
9692 list_for_each_entry_safe(hpsa_sas_phy, next,
9694 hpsa_free_sas_phy(hpsa_sas_phy);
9753 struct hpsa_sas_phy *hpsa_sas_phy;
9767 hpsa_sas_phy = hpsa_alloc_sas_phy(hpsa_sas_port);
9768 if (!hpsa_sas_phy) {
9773 rc = hpsa_sas_port_add_phy(hpsa_sas_phy);
9782 sas_phy_free(hpsa_sas_phy->phy);
9783 kfree(hpsa_sas_phy);