Lines Matching refs:phy
28 struct usb_phy *phy = NULL; in __usb_find_phy() local
30 list_for_each_entry(phy, list, head) { in __usb_find_phy()
31 if (phy->type != type) in __usb_find_phy()
34 return phy; in __usb_find_phy()
48 if (phy_bind->phy) in __usb_find_phy_dev()
49 return phy_bind->phy; in __usb_find_phy_dev()
60 struct usb_phy *phy; in __of_usb_find_phy() local
65 list_for_each_entry(phy, &phy_list, head) { in __of_usb_find_phy()
66 if (node != phy->dev->of_node) in __of_usb_find_phy()
69 return phy; in __of_usb_find_phy()
77 struct usb_phy *phy = *(struct usb_phy **)res; in devm_usb_phy_release() local
79 usb_put_phy(phy); in devm_usb_phy_release()
84 struct usb_phy **phy = res; in devm_usb_phy_match() local
86 return *phy == match_data; in devm_usb_phy_match()
102 struct usb_phy **ptr, *phy; in devm_usb_get_phy() local
108 phy = usb_get_phy(type); in devm_usb_get_phy()
109 if (!IS_ERR(phy)) { in devm_usb_get_phy()
110 *ptr = phy; in devm_usb_get_phy()
115 return phy; in devm_usb_get_phy()
131 struct usb_phy *phy = NULL; in usb_get_phy() local
136 phy = __usb_find_phy(&phy_list, type); in usb_get_phy()
137 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { in usb_get_phy()
140 if (!IS_ERR(phy)) in usb_get_phy()
141 phy = ERR_PTR(-ENODEV); in usb_get_phy()
146 get_device(phy->dev); in usb_get_phy()
151 return phy; in usb_get_phy()
173 struct usb_phy *phy = ERR_PTR(-ENOMEM), **ptr; in devm_usb_get_phy_by_phandle() local
197 phy = __of_usb_find_phy(node); in devm_usb_get_phy_by_phandle()
198 if (IS_ERR(phy)) { in devm_usb_get_phy_by_phandle()
203 if (!try_module_get(phy->dev->driver->owner)) { in devm_usb_get_phy_by_phandle()
204 phy = ERR_PTR(-ENODEV); in devm_usb_get_phy_by_phandle()
209 *ptr = phy; in devm_usb_get_phy_by_phandle()
212 get_device(phy->dev); in devm_usb_get_phy_by_phandle()
220 return phy; in devm_usb_get_phy_by_phandle()
237 struct usb_phy *phy = NULL; in usb_get_phy_dev() local
242 phy = __usb_find_phy_dev(dev, &phy_bind_list, index); in usb_get_phy_dev()
243 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { in usb_get_phy_dev()
245 if (!IS_ERR(phy)) in usb_get_phy_dev()
246 phy = ERR_PTR(-ENODEV); in usb_get_phy_dev()
251 get_device(phy->dev); in usb_get_phy_dev()
256 return phy; in usb_get_phy_dev()
273 struct usb_phy **ptr, *phy; in devm_usb_get_phy_dev() local
279 phy = usb_get_phy_dev(dev, index); in devm_usb_get_phy_dev()
280 if (!IS_ERR(phy)) { in devm_usb_get_phy_dev()
281 *ptr = phy; in devm_usb_get_phy_dev()
286 return phy; in devm_usb_get_phy_dev()
300 void devm_usb_put_phy(struct device *dev, struct usb_phy *phy) in devm_usb_put_phy() argument
304 r = devres_destroy(dev, devm_usb_phy_release, devm_usb_phy_match, phy); in devm_usb_put_phy()
341 struct usb_phy *phy; in usb_add_phy() local
352 list_for_each_entry(phy, &phy_list, head) { in usb_add_phy()
353 if (phy->type == type) { in usb_add_phy()
393 phy_bind->phy = x; in usb_add_phy_dev()
416 if (phy_bind->phy == x) in usb_remove_phy()
417 phy_bind->phy = NULL; in usb_remove_phy()