Skip to content

Commit

Permalink
phy: stm32: fix error return in stm32_usbphyc_phy_init
Browse files Browse the repository at this point in the history
[ Upstream commit 32b378a ]

Error code is overridden, in case the PLL doesn't lock. So, the USB
initialization can continue. This leads to a platform freeze.
This can be avoided by returning proper error code to avoid USB probe
freezing the platform. It also displays proper errors in log.

Fixes: 5b1af71 ("phy: stm32: rework PLL Lock detection")
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20220713133953.595134-1-fabrice.gasnier@foss.st.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Fabrice Gasnier authored and gregkh committed Aug 17, 2022
1 parent 3f2989e commit 52537ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/phy/st/phy-stm32-usbphyc.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ static int stm32_usbphyc_phy_init(struct phy *phy)
return 0;

pll_disable:
return stm32_usbphyc_pll_disable(usbphyc);
stm32_usbphyc_pll_disable(usbphyc);

return ret;
}

static int stm32_usbphyc_phy_exit(struct phy *phy)
Expand Down

0 comments on commit 52537ea

Please sign in to comment.