@@ -103,27 +103,31 @@ it. This framework provides the following APIs to get a reference to the PHY.
103103::
104104
105105 struct phy *phy_get(struct device *dev, const char *string);
106- struct phy *phy_optional_get(struct device *dev, const char *string);
107106 struct phy *devm_phy_get(struct device *dev, const char *string);
108107 struct phy *devm_phy_optional_get(struct device *dev,
109108 const char *string);
109+ struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
110+ const char *con_id);
111+ struct phy *devm_of_phy_optional_get(struct device *dev,
112+ struct device_node *np,
113+ const char *con_id);
110114 struct phy *devm_of_phy_get_by_index(struct device *dev,
111115 struct device_node *np,
112116 int index);
113117
114- phy_get, phy_optional_get, devm_phy_get and devm_phy_optional_get can
115- be used to get the PHY. In the case of dt boot, the string arguments
118+ phy_get, devm_phy_get and devm_phy_optional_get can be used to get the PHY.
119+ In the case of dt boot, the string arguments
116120should contain the phy name as given in the dt data and in the case of
117121non-dt boot, it should contain the label of the PHY. The two
118122devm_phy_get associates the device with the PHY using devres on
119123successful PHY get. On driver detach, release function is invoked on
120- the devres data and devres data is freed. phy_optional_get and
121- devm_phy_optional_get should be used when the phy is optional. These
122- two functions will never return -ENODEV, but instead returns NULL when
123- the phy cannot be found.Some generic drivers, such as ehci, may use multiple
124- phys and for such drivers referencing phy(s) by name(s) does not make sense . In
125- this case, devm_of_phy_get_by_index can be used to get a phy reference based on
126- the index.
124+ the devres data and devres data is freed.
125+ The _optional_get variants should be used when the phy is optional. These
126+ functions will never return -ENODEV, but instead return NULL when
127+ the phy cannot be found.
128+ Some generic drivers, such as ehci, may use multiple phys . In this case,
129+ devm_of_phy_get or devm_of_phy_get_by_index can be used to get a phy
130+ reference based on name or index.
127131
128132It should be noted that NULL is a valid phy reference. All phy
129133consumer calls on the NULL phy become NOPs. That is the release calls,
0 commit comments