public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] counter: ti-ecap-capture: Handle error for clk_enable
@ 2024-05-10  9:00 Chen Ni
  2024-05-11 11:58 ` William Breathitt Gray
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Ni @ 2024-05-10  9:00 UTC (permalink / raw)
  To: vigneshr, jpanis, wbg; +Cc: linux-iio, linux-omap, linux-kernel, Chen Ni

As the potential failure of the clk_enable(), it should be better to
check it and return error if fails.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/counter/ti-ecap-capture.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c
index 675447315caf..30a269fa5da0 100644
--- a/drivers/counter/ti-ecap-capture.c
+++ b/drivers/counter/ti-ecap-capture.c
@@ -574,8 +574,11 @@ static int ecap_cnt_resume(struct device *dev)
 {
 	struct counter_device *counter_dev = dev_get_drvdata(dev);
 	struct ecap_cnt_dev *ecap_dev = counter_priv(counter_dev);
+	int ret;
 
-	clk_enable(ecap_dev->clk);
+	ret = clk_enable(ecap_dev->clk);
+	if (ret)
+		return ret;
 
 	ecap_cnt_capture_set_evmode(counter_dev, ecap_dev->pm_ctx.ev_mode);
 
-- 
2.25.1


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

* Re: [PATCH] counter: ti-ecap-capture: Handle error for clk_enable
  2024-05-10  9:00 [PATCH] counter: ti-ecap-capture: Handle error for clk_enable Chen Ni
@ 2024-05-11 11:58 ` William Breathitt Gray
  0 siblings, 0 replies; 2+ messages in thread
From: William Breathitt Gray @ 2024-05-11 11:58 UTC (permalink / raw)
  To: Chen Ni; +Cc: vigneshr, jpanis, linux-iio, linux-omap, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

On Fri, May 10, 2024 at 05:00:59PM +0800, Chen Ni wrote:
> As the potential failure of the clk_enable(), it should be better to
> check it and return error if fails.
> 
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> ---
>  drivers/counter/ti-ecap-capture.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c
> index 675447315caf..30a269fa5da0 100644
> --- a/drivers/counter/ti-ecap-capture.c
> +++ b/drivers/counter/ti-ecap-capture.c
> @@ -574,8 +574,11 @@ static int ecap_cnt_resume(struct device *dev)
>  {
>  	struct counter_device *counter_dev = dev_get_drvdata(dev);
>  	struct ecap_cnt_dev *ecap_dev = counter_priv(counter_dev);
> +	int ret;
>  
> -	clk_enable(ecap_dev->clk);
> +	ret = clk_enable(ecap_dev->clk);
> +	if (ret)
> +		return ret;
>  
>  	ecap_cnt_capture_set_evmode(counter_dev, ecap_dev->pm_ctx.ev_mode);
>  
> -- 
> 2.25.1

Hi Chen,

Would you add a Fixes tag so we can pick this up for the stable kernels
too?

Thanks,

William Breathitt Gray

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2024-05-11 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-10  9:00 [PATCH] counter: ti-ecap-capture: Handle error for clk_enable Chen Ni
2024-05-11 11:58 ` William Breathitt Gray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox