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 <marek.vasut@mailbox.org>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
{
struct phy_counts *counts;
struct phy_ops const *ops;
- int ret;
+ int ret = 0;
if (!generic_phy_valid(phy))
return 0;
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)