* [PATCH 1/1] rtc: snvs: fix an incorrect check of return value
@ 2017-04-23 5:43 Pan Bian
2017-05-04 22:58 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Pan Bian @ 2017-04-23 5:43 UTC (permalink / raw)
To: Alessandro Zummo, Alexandre Belloni; +Cc: rtc-linux, linux-kernel, Pan Bian
Function devm_regmap_init_mmio() returns an ERR_PTR on error. However,
in function snvs_rtc_probe() its return value is checked against NULL.
This patch fixes it by checking the return value with IS_ERR().
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
drivers/rtc/rtc-snvs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c
index d51b07d..d8ef9e0 100644
--- a/drivers/rtc/rtc-snvs.c
+++ b/drivers/rtc/rtc-snvs.c
@@ -258,7 +258,7 @@ static int snvs_rtc_probe(struct platform_device *pdev)
of_property_read_u32(pdev->dev.of_node, "offset", &data->offset);
}
- if (!data->regmap) {
+ if (IS_ERR(data->regmap)) {
dev_err(&pdev->dev, "Can't find snvs syscon\n");
return -ENODEV;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] rtc: snvs: fix an incorrect check of return value
2017-04-23 5:43 [PATCH 1/1] rtc: snvs: fix an incorrect check of return value Pan Bian
@ 2017-05-04 22:58 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2017-05-04 22:58 UTC (permalink / raw)
To: Pan Bian; +Cc: Alessandro Zummo, rtc-linux, linux-kernel
On 23/04/2017 at 13:43:24 +0800, Pan Bian wrote:
> Function devm_regmap_init_mmio() returns an ERR_PTR on error. However,
> in function snvs_rtc_probe() its return value is checked against NULL.
> This patch fixes it by checking the return value with IS_ERR().
>
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
> drivers/rtc/rtc-snvs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Applied, thanks.
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-04 22:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-23 5:43 [PATCH 1/1] rtc: snvs: fix an incorrect check of return value Pan Bian
2017-05-04 22:58 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).