Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1577230 > unrolled thread
| Started by | Wei Yongjun <weiyj.lk@gmail.com> |
|---|---|
| First post | 2017-02-09 01:50 +0100 |
| Last post | 2017-02-12 00:40 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() Wei Yongjun <weiyj.lk@gmail.com> - 2017-02-09 01:50 +0100
Re: [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-02-09 08:50 +0100
Re: [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-02-12 00:40 +0100
| From | Wei Yongjun <weiyj.lk@gmail.com> |
|---|---|
| Date | 2017-02-09 01:50 +0100 |
| Subject | [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() |
| Message-ID | <t8L5T-7nW-21@gated-at.bofh.it> |
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;
}
[toc] | [next] | [standalone]
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Date | 2017-02-09 08:50 +0100 |
| Subject | Re: [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() |
| Message-ID | <t8REl-3ed-1@gated-at.bofh.it> |
| In reply to | #1577230 |
[Multipart message — attachments visible in raw view] — view raw
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
[toc] | [prev] | [next] | [standalone]
| From | Alexandre Belloni <alexandre.belloni@free-electrons.com> |
|---|---|
| Date | 2017-02-12 00:40 +0100 |
| Subject | Re: [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() |
| Message-ID | <t9PqN-75l-1@gated-at.bofh.it> |
| In reply to | #1577230 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web