Commit aaa65a9c authored by Wei Yongjun's avatar Wei Yongjun Committed by Alexandre Belloni

rtc: sun6i: Fix return value check in sun6i_rtc_clk_init()

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: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent 93946c49
...@@ -202,7 +202,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node) ...@@ -202,7 +202,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node)
spin_lock_init(&rtc->lock); spin_lock_init(&rtc->lock);
rtc->base = of_io_request_and_map(node, 0, of_node_full_name(node)); 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"); pr_crit("Can't map RTC registers");
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment