From: Wei Yongjun Date: Thu, 9 Feb 2017 00:16:13 +0000 (+0000) Subject: rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aaa65a9ce685fcdf37d647ec1ef5afeb3d02c916;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Wei Yongjun Acked-by: Maxime Ripard Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 08510ca58996..39cbc1238b92 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; }