* [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init()
@ 2017-02-09 0:16 Wei Yongjun
2017-02-09 7:34 ` Maxime Ripard
2017-02-11 23:39 ` Alexandre Belloni
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2017-02-09 0:16 UTC (permalink / raw)
To: Alessandro Zummo, Alexandre Belloni, Maxime Ripard, Chen-Yu Tsai
Cc: Wei Yongjun, rtc-linux, linux-arm-kernel, linux-kernel
From: Wei Yongjun <weiyongjun1@huawei.com>
In case of error, the function of_io_request_and_map() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().
Fixes: 847b8bf62eb4 ("rtc: sun6i: Expose the 32kHz oscillator")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/rtc/rtc-sun6i.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
index 08510ca..39cbc12 100644
--- a/drivers/rtc/rtc-sun6i.c
+++ b/drivers/rtc/rtc-sun6i.c
@@ -202,7 +202,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node)
spin_lock_init(&rtc->lock);
rtc->base = of_io_request_and_map(node, 0, of_node_full_name(node));
- if (!rtc->base) {
+ if (IS_ERR(rtc->base)) {
pr_crit("Can't map RTC registers");
return;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init()
2017-02-09 0:16 [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() Wei Yongjun
@ 2017-02-09 7:34 ` Maxime Ripard
2017-02-11 23:39 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2017-02-09 7:34 UTC (permalink / raw)
To: Wei Yongjun
Cc: Alessandro Zummo, Alexandre Belloni, Chen-Yu Tsai, Wei Yongjun,
rtc-linux, linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 603 bytes --]
On Thu, Feb 09, 2017 at 12:16:13AM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function of_io_request_and_map() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
>
> Fixes: 847b8bf62eb4 ("rtc: sun6i: Expose the 32kHz oscillator")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init()
2017-02-09 0:16 [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() Wei Yongjun
2017-02-09 7:34 ` Maxime Ripard
@ 2017-02-11 23:39 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2017-02-11 23:39 UTC (permalink / raw)
To: Wei Yongjun
Cc: Alessandro Zummo, Maxime Ripard, Chen-Yu Tsai, Wei Yongjun,
rtc-linux, linux-arm-kernel, linux-kernel
On 09/02/2017 at 00:16:13 +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function of_io_request_and_map() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
>
> Fixes: 847b8bf62eb4 ("rtc: sun6i: Expose the 32kHz oscillator")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/rtc/rtc-sun6i.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] 3+ messages in thread
end of thread, other threads:[~2017-02-11 23:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09 0:16 [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() Wei Yongjun
2017-02-09 7:34 ` Maxime Ripard
2017-02-11 23:39 ` 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).