Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path

If rockchip_usb_phy_power() fails, we need to call clk_disable_unprepare()
before return. This is to ensure we have balanced clk_enable/disable calls.
Also remove unneeded ret checking in rockchip_usb_phy_power_off.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Axel Lin and committed by
Kishon Vijay Abraham I
6b08e36b a5e5d3c0

+3 -3
+3 -3
drivers/phy/phy-rockchip-usb.c
··· 61 61 return ret; 62 62 63 63 clk_disable_unprepare(phy->clk); 64 - if (ret) 65 - return ret; 66 64 67 65 return 0; 68 66 } ··· 76 78 77 79 /* Power up usb phy analog blocks by set siddq 0 */ 78 80 ret = rockchip_usb_phy_power(phy, 0); 79 - if (ret) 81 + if (ret) { 82 + clk_disable_unprepare(phy->clk); 80 83 return ret; 84 + } 81 85 82 86 return 0; 83 87 }