Skip to contentSkip to conversation

rtc: rzn1: Check return value in rzn1_rtc_probe

PATCH Applied [email protected] 3 participants 3 messages Nov 7, 2022 – Nov 14, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: rzn1: Check return value in rzn1_rtc_probe

From: Yushan Zhou <[email protected]>

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")
---
 drivers/rtc/rtc-rzn1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/rtc/rtc-rzn1.c +3 -1
index ac788799c8e3..0d36bc50197c 100644
@@ -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;
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hello,

[email protected] wrote on Mon, 7 Nov 2022 17:25:44 +0800:

Quoted 18 lines

From: Yushan Zhou <[email protected]>

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")
---
 drivers/rtc/rtc-rzn1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/rtc/rtc-rzn1.c +0 -0
index ac788799c8e3..0d36bc50197c 100644

drivers/rtc/rtc-rzn1.c static int rzn1_rtc_probe(struct platform_device *pdev) · line 363

Quoted 10 lines
drivers/rtc/rtc-rzn1.c +3 -1
@@ -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;

Thanks,
Miquèl

maintainer Applied
#2 lore raw
In reply to [email protected]
Quoted 9 lines · On Mon, 7 Nov 2022 17:25:44 +0800, [email protected] wrote:

From: Yushan Zhou <[email protected]>

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,

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