diff options
author | Jonas Karlman <jonas@kwiboo.se> | 2023-08-31 23:07:08 +0000 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-09-13 15:52:21 -0400 |
commit | bd78f2c2c28ca93311a7e1cdddefbd08a7cf9f70 (patch) | |
tree | 55f3b9d83d49dc864f577a87768fcfca90b9270a /drivers/phy/phy-uclass.c | |
parent | 3b4e6e94621ef0d3f356f821a403e03e8fac0828 (diff) |
phy: Fix generic_setup_phy() return value on power on failure
generic_phy_exit() typically return 0 for a struct phy that has been
initialized with a generic_phy_init() call.
generic_setup_phy() returns the value from a generic_phy_exit() call
when generic_phy_power_on() fails. This hides the failed state of the
power_on ops from the caller of generic_setup_phy().
Fix this by ignoring the return value of the generic_phy_exit() call and
return the value from the generic_phy_power_on() call.
Fixes: 84e561407a5f ("phy: Add generic_{setup,shutdown}_phy() helpers")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Diffstat (limited to 'drivers/phy/phy-uclass.c')
-rw-r--r-- | drivers/phy/phy-uclass.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/phy/phy-uclass.c b/drivers/phy/phy-uclass.c index 7d707c02293..d745e7babc1 100644 --- a/drivers/phy/phy-uclass.c +++ b/drivers/phy/phy-uclass.c @@ -526,7 +526,7 @@ int generic_setup_phy(struct udevice *dev, struct phy *phy, int index) ret = generic_phy_power_on(phy); if (ret) - ret = generic_phy_exit(phy); + generic_phy_exit(phy); } return ret; |