mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
drivers: phy: Add support for optional phys
Add devm_phy_optional_get and phy_optional_get, which should be used when the phy is optional. They does not return an error when the phy does not exist, rather they returns NULL, which is considered as a valid phy, but results in NOPs when used with the consumer API. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
This commit is contained in:
parent
04c2facad8
commit
788a4d56ff
3 changed files with 71 additions and 6 deletions
|
@ -146,7 +146,9 @@ static inline void phy_set_bus_width(struct phy *phy, int bus_width)
|
|||
phy->attrs.bus_width = bus_width;
|
||||
}
|
||||
struct phy *phy_get(struct device *dev, const char *string);
|
||||
struct phy *phy_optional_get(struct device *dev, const char *string);
|
||||
struct phy *devm_phy_get(struct device *dev, const char *string);
|
||||
struct phy *devm_phy_optional_get(struct device *dev, const char *string);
|
||||
void phy_put(struct phy *phy);
|
||||
void devm_phy_put(struct device *dev, struct phy *phy);
|
||||
struct phy *of_phy_simple_xlate(struct device *dev,
|
||||
|
@ -232,11 +234,23 @@ static inline struct phy *phy_get(struct device *dev, const char *string)
|
|||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
||||
static inline struct phy *phy_optional_get(struct device *dev,
|
||||
const char *string)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
||||
static inline struct phy *devm_phy_get(struct device *dev, const char *string)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
||||
static inline struct phy *devm_phy_optional_get(struct device *dev,
|
||||
const char *string)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
||||
static inline void phy_put(struct phy *phy)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue