* [PATCH] irqchip/aspeed-i2c-ic: Fix return value check in aspeed_i2c_ic_of_init()
@ 2017-10-11 10:50 ` Wei Yongjun
0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2017-10-11 10:50 UTC (permalink / raw)
To: Joel Stanley, Brendan Higgins, Benjamin Herrenschmidt,
Thomas Gleixner, Jason Cooper, Marc Zyngier
Cc: Wei Yongjun, linux-i2c, openbmc
In case of error, the function of_iomap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test..
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/irqchip/irq-aspeed-i2c-ic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c
index 815b88d..f20200a 100644
--- a/drivers/irqchip/irq-aspeed-i2c-ic.c
+++ b/drivers/irqchip/irq-aspeed-i2c-ic.c
@@ -76,8 +76,8 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node,
return -ENOMEM;
i2c_ic->base = of_iomap(node, 0);
- if (IS_ERR(i2c_ic->base)) {
- ret = PTR_ERR(i2c_ic->base);
+ if (!i2c_ic->base) {
+ ret = -ENOMEM;
goto err_free_ic;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] irqchip/aspeed-i2c-ic: Fix return value check in aspeed_i2c_ic_of_init()
@ 2017-10-11 10:50 ` Wei Yongjun
0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2017-10-11 10:50 UTC (permalink / raw)
To: Joel Stanley, Brendan Higgins, Benjamin Herrenschmidt,
Thomas Gleixner, Jason Cooper, Marc Zyngier
Cc: Wei Yongjun, linux-i2c, openbmc
In case of error, the function of_iomap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test..
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/irqchip/irq-aspeed-i2c-ic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c
index 815b88d..f20200a 100644
--- a/drivers/irqchip/irq-aspeed-i2c-ic.c
+++ b/drivers/irqchip/irq-aspeed-i2c-ic.c
@@ -76,8 +76,8 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node,
return -ENOMEM;
i2c_ic->base = of_iomap(node, 0);
- if (IS_ERR(i2c_ic->base)) {
- ret = PTR_ERR(i2c_ic->base);
+ if (!i2c_ic->base) {
+ ret = -ENOMEM;
goto err_free_ic;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] irqchip/aspeed-i2c-ic: Fix return value check in aspeed_i2c_ic_of_init()
2017-10-11 10:50 ` Wei Yongjun
@ 2017-10-19 1:01 ` Brendan Higgins
-1 siblings, 0 replies; 4+ messages in thread
From: Brendan Higgins @ 2017-10-19 1:01 UTC (permalink / raw)
To: Wei Yongjun
Cc: Joel Stanley, Benjamin Herrenschmidt, Thomas Gleixner,
Jason Cooper, Marc Zyngier, linux-i2c, OpenBMC Maillist
On Wed, Oct 11, 2017 at 3:50 AM, Wei Yongjun <weiyongjun1@huawei.com> wrote:
> In case of error, the function of_iomap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test..
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/irqchip/irq-aspeed-i2c-ic.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c
> index 815b88d..f20200a 100644
> --- a/drivers/irqchip/irq-aspeed-i2c-ic.c
> +++ b/drivers/irqchip/irq-aspeed-i2c-ic.c
> @@ -76,8 +76,8 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node,
> return -ENOMEM;
>
> i2c_ic->base = of_iomap(node, 0);
> - if (IS_ERR(i2c_ic->base)) {
> - ret = PTR_ERR(i2c_ic->base);
> + if (!i2c_ic->base) {
> + ret = -ENOMEM;
> goto err_free_ic;
> }
>
>
>
>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] irqchip/aspeed-i2c-ic: Fix return value check in aspeed_i2c_ic_of_init()
@ 2017-10-19 1:01 ` Brendan Higgins
0 siblings, 0 replies; 4+ messages in thread
From: Brendan Higgins @ 2017-10-19 1:01 UTC (permalink / raw)
To: Wei Yongjun
Cc: Joel Stanley, Benjamin Herrenschmidt, Thomas Gleixner,
Jason Cooper, Marc Zyngier, linux-i2c, OpenBMC Maillist
On Wed, Oct 11, 2017 at 3:50 AM, Wei Yongjun <weiyongjun1@huawei.com> wrote:
> In case of error, the function of_iomap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test..
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/irqchip/irq-aspeed-i2c-ic.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c
> index 815b88d..f20200a 100644
> --- a/drivers/irqchip/irq-aspeed-i2c-ic.c
> +++ b/drivers/irqchip/irq-aspeed-i2c-ic.c
> @@ -76,8 +76,8 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node,
> return -ENOMEM;
>
> i2c_ic->base = of_iomap(node, 0);
> - if (IS_ERR(i2c_ic->base)) {
> - ret = PTR_ERR(i2c_ic->base);
> + if (!i2c_ic->base) {
> + ret = -ENOMEM;
> goto err_free_ic;
> }
>
>
>
>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-19 1:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-11 10:50 [PATCH] irqchip/aspeed-i2c-ic: Fix return value check in aspeed_i2c_ic_of_init() Wei Yongjun
2017-10-11 10:50 ` Wei Yongjun
2017-10-19 1:01 ` Brendan Higgins
2017-10-19 1:01 ` Brendan Higgins
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.