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

phy: qualcomm: call clk_disable_unprepare in the error handling

Smatch reports the following error:

drivers/phy/qualcomm/phy-qcom-usb-hsic.c:82 qcom_usb_hsic_phy_power_on()
warn: 'uphy->cal_clk' from clk_prepare_enable() not released on lines:
58.
drivers/phy/qualcomm/phy-qcom-usb-hsic.c:82 qcom_usb_hsic_phy_power_on()
warn: 'uphy->cal_sleep_clk' from clk_prepare_enable() not released on
lines: 58.
drivers/phy/qualcomm/phy-qcom-usb-hsic.c:82 qcom_usb_hsic_phy_power_on()
warn: 'uphy->phy_clk' from clk_prepare_enable() not released on lines:
58.

Fix this by calling proper clk_disable_unprepare calls.

Fixes: 0b56e9a7e835 ("phy: Group vendor specific phy drivers")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20220914051334.69282-1-dzm91@hust.edu.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Dongliang Mu and committed by
Vinod Koul
c3966ced 7706630c

+4 -2
+4 -2
drivers/phy/qualcomm/phy-qcom-usb-hsic.c
··· 54 54 55 55 /* Configure pins for HSIC functionality */ 56 56 pins_default = pinctrl_lookup_state(uphy->pctl, PINCTRL_STATE_DEFAULT); 57 - if (IS_ERR(pins_default)) 58 - return PTR_ERR(pins_default); 57 + if (IS_ERR(pins_default)) { 58 + ret = PTR_ERR(pins_default); 59 + goto err_ulpi; 60 + } 59 61 60 62 ret = pinctrl_select_state(uphy->pctl, pins_default); 61 63 if (ret)