Message ID | 1653372586-24736-1-git-send-email-baihaowen@meizu.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | 0b6da785130d9e8cf33d001a7bf08a979c87d019 |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | rtc: rzn1: Fix inconsistent IS_ERR and PTR_ERR | expand |
Hi Haowen, baihaowen@meizu.com wrote on Tue, 24 May 2022 14:09:45 +0800: > The proper pointer to be passed as argument is rtc->rtcdev. > Detected using Coccinelle. > > Fixes: deeb4b5393e1 ("rtc: rzn1: Add new RTC driver") Thanks for your patch. This has already been reported twice, Alexandre will likely apply one of the fixes after the merge window. > > Signed-off-by: Haowen Bai <baihaowen@meizu.com> > --- > drivers/rtc/rtc-rzn1.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c > index f92d1398b0f1..4cf54af8a8c3 100644 > --- a/drivers/rtc/rtc-rzn1.c > +++ b/drivers/rtc/rtc-rzn1.c > @@ -348,7 +348,7 @@ static int rzn1_rtc_probe(struct platform_device *pdev) > > rtc->rtcdev = devm_rtc_allocate_device(&pdev->dev); > if (IS_ERR(rtc->rtcdev)) > - return PTR_ERR(rtc); > + return PTR_ERR(rtc->rtcdev); > > rtc->rtcdev->range_min = RTC_TIMESTAMP_BEGIN_2000; > rtc->rtcdev->range_max = RTC_TIMESTAMP_END_2099; Thanks, Miquèl
diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c index f92d1398b0f1..4cf54af8a8c3 100644 --- a/drivers/rtc/rtc-rzn1.c +++ b/drivers/rtc/rtc-rzn1.c @@ -348,7 +348,7 @@ static int rzn1_rtc_probe(struct platform_device *pdev) rtc->rtcdev = devm_rtc_allocate_device(&pdev->dev); if (IS_ERR(rtc->rtcdev)) - return PTR_ERR(rtc); + return PTR_ERR(rtc->rtcdev); rtc->rtcdev->range_min = RTC_TIMESTAMP_BEGIN_2000; rtc->rtcdev->range_max = RTC_TIMESTAMP_END_2099;
The proper pointer to be passed as argument is rtc->rtcdev. Detected using Coccinelle. Fixes: deeb4b5393e1 ("rtc: rzn1: Add new RTC driver") Signed-off-by: Haowen Bai <baihaowen@meizu.com> --- drivers/rtc/rtc-rzn1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)