All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: qualcomm:  call clk_disable_unprepare in the error handling
@ 2022-09-14  5:13 ` Dongliang Mu
  0 siblings, 0 replies; 6+ messages in thread
From: Dongliang Mu @ 2022-09-14  5:13 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Kishon Vijay Abraham I, Vinod Koul, Heiko Stuebner, Vivek Gautam,
	Krzysztof Kozlowski, Jaehoon Chung
  Cc: Dongliang Mu, Viresh Kumar, linux-arm-msm, linux-phy, linux-kernel

From: Dongliang Mu <mudongliangabcd@gmail.com>

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>
---
 drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
index 716a77748ed8..20f6dd37c7c1 100644
--- a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
+++ b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
@@ -54,8 +54,10 @@ static int qcom_usb_hsic_phy_power_on(struct phy *phy)
 
 	/* Configure pins for HSIC functionality */
 	pins_default = pinctrl_lookup_state(uphy->pctl, PINCTRL_STATE_DEFAULT);
-	if (IS_ERR(pins_default))
-		return PTR_ERR(pins_default);
+	if (IS_ERR(pins_default)) {
+		ret = PTR_ERR(pins_default);
+		goto err_ulpi;
+	}
 
 	ret = pinctrl_select_state(uphy->pctl, pins_default);
 	if (ret)
-- 
2.35.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] phy: qualcomm:  call clk_disable_unprepare in the error handling
@ 2022-09-14  5:13 ` Dongliang Mu
  0 siblings, 0 replies; 6+ messages in thread
From: Dongliang Mu @ 2022-09-14  5:13 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Kishon Vijay Abraham I, Vinod Koul, Heiko Stuebner, Vivek Gautam,
	Krzysztof Kozlowski, Jaehoon Chung
  Cc: Dongliang Mu, Viresh Kumar, linux-arm-msm, linux-phy, linux-kernel

From: Dongliang Mu <mudongliangabcd@gmail.com>

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>
---
 drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
index 716a77748ed8..20f6dd37c7c1 100644
--- a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
+++ b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
@@ -54,8 +54,10 @@ static int qcom_usb_hsic_phy_power_on(struct phy *phy)
 
 	/* Configure pins for HSIC functionality */
 	pins_default = pinctrl_lookup_state(uphy->pctl, PINCTRL_STATE_DEFAULT);
-	if (IS_ERR(pins_default))
-		return PTR_ERR(pins_default);
+	if (IS_ERR(pins_default)) {
+		ret = PTR_ERR(pins_default);
+		goto err_ulpi;
+	}
 
 	ret = pinctrl_select_state(uphy->pctl, pins_default);
 	if (ret)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] phy: qualcomm: call clk_disable_unprepare in the error handling
  2022-09-14  5:13 ` Dongliang Mu
@ 2022-09-20 13:30   ` Neil Armstrong
  -1 siblings, 0 replies; 6+ messages in thread
From: Neil Armstrong @ 2022-09-20 13:30 UTC (permalink / raw)
  To: Dongliang Mu, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Kishon Vijay Abraham I, Vinod Koul, Heiko Stuebner, Vivek Gautam,
	Krzysztof Kozlowski, Jaehoon Chung
  Cc: Dongliang Mu, Viresh Kumar, linux-arm-msm, linux-phy, linux-kernel

On 14/09/2022 07:13, Dongliang Mu wrote:
> From: Dongliang Mu <mudongliangabcd@gmail.com>
> 
> 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>
> ---
>   drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
> index 716a77748ed8..20f6dd37c7c1 100644
> --- a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
> +++ b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
> @@ -54,8 +54,10 @@ static int qcom_usb_hsic_phy_power_on(struct phy *phy)
>   
>   	/* Configure pins for HSIC functionality */
>   	pins_default = pinctrl_lookup_state(uphy->pctl, PINCTRL_STATE_DEFAULT);
> -	if (IS_ERR(pins_default))
> -		return PTR_ERR(pins_default);
> +	if (IS_ERR(pins_default)) {
> +		ret = PTR_ERR(pins_default);
> +		goto err_ulpi;
> +	}
>   
>   	ret = pinctrl_select_state(uphy->pctl, pins_default);
>   	if (ret)

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] phy: qualcomm: call clk_disable_unprepare in the error handling
@ 2022-09-20 13:30   ` Neil Armstrong
  0 siblings, 0 replies; 6+ messages in thread
From: Neil Armstrong @ 2022-09-20 13:30 UTC (permalink / raw)
  To: Dongliang Mu, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Kishon Vijay Abraham I, Vinod Koul, Heiko Stuebner, Vivek Gautam,
	Krzysztof Kozlowski, Jaehoon Chung
  Cc: Dongliang Mu, Viresh Kumar, linux-arm-msm, linux-phy, linux-kernel

On 14/09/2022 07:13, Dongliang Mu wrote:
> From: Dongliang Mu <mudongliangabcd@gmail.com>
> 
> 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>
> ---
>   drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
> index 716a77748ed8..20f6dd37c7c1 100644
> --- a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
> +++ b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c
> @@ -54,8 +54,10 @@ static int qcom_usb_hsic_phy_power_on(struct phy *phy)
>   
>   	/* Configure pins for HSIC functionality */
>   	pins_default = pinctrl_lookup_state(uphy->pctl, PINCTRL_STATE_DEFAULT);
> -	if (IS_ERR(pins_default))
> -		return PTR_ERR(pins_default);
> +	if (IS_ERR(pins_default)) {
> +		ret = PTR_ERR(pins_default);
> +		goto err_ulpi;
> +	}
>   
>   	ret = pinctrl_select_state(uphy->pctl, pins_default);
>   	if (ret)

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] phy: qualcomm:  call clk_disable_unprepare in the error handling
  2022-09-14  5:13 ` Dongliang Mu
@ 2022-09-24  7:18   ` Vinod Koul
  -1 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2022-09-24  7:18 UTC (permalink / raw)
  To: Dongliang Mu
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Kishon Vijay Abraham I, Heiko Stuebner, Vivek Gautam,
	Krzysztof Kozlowski, Jaehoon Chung, Dongliang Mu, Viresh Kumar,
	linux-arm-msm, linux-phy, linux-kernel

On 14-09-22, 13:13, Dongliang Mu wrote:
> From: Dongliang Mu <mudongliangabcd@gmail.com>
> 
> 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.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] phy: qualcomm:  call clk_disable_unprepare in the error handling
@ 2022-09-24  7:18   ` Vinod Koul
  0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2022-09-24  7:18 UTC (permalink / raw)
  To: Dongliang Mu
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Kishon Vijay Abraham I, Heiko Stuebner, Vivek Gautam,
	Krzysztof Kozlowski, Jaehoon Chung, Dongliang Mu, Viresh Kumar,
	linux-arm-msm, linux-phy, linux-kernel

On 14-09-22, 13:13, Dongliang Mu wrote:
> From: Dongliang Mu <mudongliangabcd@gmail.com>
> 
> 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.

Applied, thanks

-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-24  7:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14  5:13 [PATCH] phy: qualcomm: call clk_disable_unprepare in the error handling Dongliang Mu
2022-09-14  5:13 ` Dongliang Mu
2022-09-20 13:30 ` Neil Armstrong
2022-09-20 13:30   ` Neil Armstrong
2022-09-24  7:18 ` Vinod Koul
2022-09-24  7:18   ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.