All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: rzn1: Check return value in rzn1_rtc_probe
@ 2022-11-07  9:25 zys.zljxml
  2022-11-07  9:49 ` Miquel Raynal
  2022-11-14 17:34 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: zys.zljxml @ 2022-11-07  9:25 UTC (permalink / raw)
  To: miquel.raynal, a.zummo, alexandre.belloni, michel.pollet
  Cc: linux-rtc, linux-renesas-soc, linux-kernel, Yushan Zhou

From: Yushan Zhou <katrinzhou@tencent.com>

The rzn1_rtc_probe() function utilizes devm_pm_runtime_enable()
but wasn't checking the return value. Fix it by adding missing
check.

Fixes: deeb4b5393e1 ("rtc: rzn1: Add new RTC driver")

Signed-off-by: Yushan Zhou <katrinzhou@tencent.com>
---
 drivers/rtc/rtc-rzn1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c
index ac788799c8e3..0d36bc50197c 100644
--- a/drivers/rtc/rtc-rzn1.c
+++ b/drivers/rtc/rtc-rzn1.c
@@ -355,7 +355,9 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
 	set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
 	clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
 
-	devm_pm_runtime_enable(&pdev->dev);
+	ret = devm_pm_runtime_enable(&pdev->dev);
+	if (ret < 0)
+		return ret;
 	ret = pm_runtime_resume_and_get(&pdev->dev);
 	if (ret < 0)
 		return ret;
-- 
2.27.0


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

* Re: [PATCH] rtc: rzn1: Check return value in rzn1_rtc_probe
  2022-11-07  9:25 [PATCH] rtc: rzn1: Check return value in rzn1_rtc_probe zys.zljxml
@ 2022-11-07  9:49 ` Miquel Raynal
  2022-11-14 17:34 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2022-11-07  9:49 UTC (permalink / raw)
  To: zys.zljxml
  Cc: a.zummo, alexandre.belloni, michel.pollet, linux-rtc,
	linux-renesas-soc, linux-kernel, Yushan Zhou

Hello,

zys.zljxml@gmail.com wrote on Mon,  7 Nov 2022 17:25:44 +0800:

> From: Yushan Zhou <katrinzhou@tencent.com>
> 
> The rzn1_rtc_probe() function utilizes devm_pm_runtime_enable()
> but wasn't checking the return value. Fix it by adding missing
> check.
> 
> Fixes: deeb4b5393e1 ("rtc: rzn1: Add new RTC driver")
> 
> Signed-off-by: Yushan Zhou <katrinzhou@tencent.com>
> ---
>  drivers/rtc/rtc-rzn1.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c
> index ac788799c8e3..0d36bc50197c 100644
> --- a/drivers/rtc/rtc-rzn1.c
> +++ b/drivers/rtc/rtc-rzn1.c
> @@ -355,7 +355,9 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
>  	set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
>  	clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
>  
> -	devm_pm_runtime_enable(&pdev->dev);
> +	ret = devm_pm_runtime_enable(&pdev->dev);
> +	if (ret < 0)
> +		return ret;
>  	ret = pm_runtime_resume_and_get(&pdev->dev);
>  	if (ret < 0)
>  		return ret;

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

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

* Re: [PATCH] rtc: rzn1: Check return value in rzn1_rtc_probe
  2022-11-07  9:25 [PATCH] rtc: rzn1: Check return value in rzn1_rtc_probe zys.zljxml
  2022-11-07  9:49 ` Miquel Raynal
@ 2022-11-14 17:34 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2022-11-14 17:34 UTC (permalink / raw)
  To: a.zummo, zys.zljxml, miquel.raynal, michel.pollet
  Cc: linux-rtc, Yushan Zhou, linux-renesas-soc, linux-kernel

On Mon, 7 Nov 2022 17:25:44 +0800, zys.zljxml@gmail.com wrote:
> From: Yushan Zhou <katrinzhou@tencent.com>
> 
> The rzn1_rtc_probe() function utilizes devm_pm_runtime_enable()
> but wasn't checking the return value. Fix it by adding missing
> check.
> 
> Fixes: deeb4b5393e1 ("rtc: rzn1: Add new RTC driver")
> 
> [...]

Applied, thanks!

[1/1] rtc: rzn1: Check return value in rzn1_rtc_probe
      commit: 0ef7422f0f40423143b6488e52a30444f33cdc89

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2022-11-14 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-07  9:25 [PATCH] rtc: rzn1: Check return value in rzn1_rtc_probe zys.zljxml
2022-11-07  9:49 ` Miquel Raynal
2022-11-14 17:34 ` Alexandre Belloni

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.