]> git.dujemihanovic.xyz Git - u-boot.git/commit
phy: Fix generic_setup_phy() return value on power on failure
authorJonas Karlman <jonas@kwiboo.se>
Thu, 31 Aug 2023 23:07:08 +0000 (23:07 +0000)
committerTom Rini <trini@konsulko.com>
Wed, 13 Sep 2023 19:52:21 +0000 (15:52 -0400)
commitbd78f2c2c28ca93311a7e1cdddefbd08a7cf9f70
tree55f3b9d83d49dc864f577a87768fcfca90b9270a
parent3b4e6e94621ef0d3f356f821a403e03e8fac0828
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>
drivers/phy/phy-uclass.c
test/dm/phy.c