Thread (3 messages) flat view 3 messages, 3 authors, 2017-02-11
STALE3463d

[PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init()

From: Wei Yongjun <hidden>
Date: 2017-02-09 00:42:51
Also in: linux-rtc, lkml
Subsystem: real time clock (rtc) subsystem, the rest · Maintainers: Alexandre Belloni, Linus Torvalds

From: Wei Yongjun <redacted>

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 <redacted>
---
 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;
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help