summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2025-09-07 01:00:44 +0200
committerTom Rini <[email protected]>2025-09-16 16:14:03 -0600
commitc6a4b44cdcc11431223a9d9db17de0c587d49c72 (patch)
tree57f03b82ede6255f0a053d0183cc5e40f878d233 /drivers
parent27fc6a67a4ca0ab565a1135a30b1e132de3bbed8 (diff)
phy: Reset init count on phy exit failure
In case the PHY exit callback reports failure, reset init_count to 0 anyway, so the next attempt at PHY initialization might try to reinitialize the PHY and restore it to normal operation. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Siddharth Vadapalli <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/phy/phy-uclass.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/phy/phy-uclass.c b/drivers/phy/phy-uclass.c
index 714be123856..f8d4fb3b41b 100644
--- a/drivers/phy/phy-uclass.c
+++ b/drivers/phy/phy-uclass.c
@@ -274,7 +274,7 @@ int generic_phy_exit(struct phy *phy)
{
struct phy_counts *counts;
struct phy_ops const *ops;
- int ret;
+ int ret = 0;
if (!generic_phy_valid(phy))
return 0;
@@ -292,12 +292,11 @@ int generic_phy_exit(struct phy *phy)
if (ret) {
dev_err(phy->dev, "PHY: Failed to exit %s: %d.\n",
phy->dev->name, ret);
- return ret;
}
}
counts->init_count = 0;
- return 0;
+ return ret;
}
int generic_phy_power_on(struct phy *phy)