rtc: sun6i: Fix return value check in sun6i_rtc_clk_init()
Subsystems (2)
PATCH 1/1 rtc: sun6i: Fix return value check in sun6i_rtc_clk_init()
From: Wei Yongjun <[email protected]>
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 <[email protected]>
--- drivers/rtc/rtc-sun6i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-sun6i.c +1 -1
@@ -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 ; }
Quoted 8 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
In case of error, the function
of_io_request_and_map()returnsERR_PTR()and never returns NULL. The NULL test in the return value check should be replaced withIS_ERR().Fixes 847b8bf62eb4 ("rtc: sun6i: Expose the 32kHz oscillator")Signed-off-by Wei Yongjun <[email protected]>
Acked-by Maxime Ripard <[email protected]>
Thanks,
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170209/a15a4a4f/attachment-0001.sig>
Alexandre Belloni
AppliedQuoted 6 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
In case of error, the function
of_io_request_and_map()returnsERR_PTR()and never returns NULL. The NULL test in the return value check should be replaced withIS_ERR().
Quoted 6 lines
Fixes 847b8bf62eb4 ("rtc: sun6i: Expose the 32kHz oscillator")Signed-off-by Wei Yongjun <[email protected]>--- drivers/rtc/rtc-sun6i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com