* [PATCH -next] irqchip: irq-rda-intc: Fix return value check in rda8810_intc_init()
@ 2018-12-17 11:58 Wei Yongjun
2018-12-17 12:31 ` Manivannan Sadhasivam
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2018-12-17 11:58 UTC (permalink / raw)
To: Thomas Gleixner, Jason Cooper, Marc Zyngier, Manivannan Sadhasivam
Cc: Wei Yongjun, linux-kernel, kernel-janitors
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: d852e62ad689 ("irqchip: Add RDA8810PL interrupt driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/irqchip/irq-rda-intc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-rda-intc.c b/drivers/irqchip/irq-rda-intc.c
index 1176291..9601683 100644
--- a/drivers/irqchip/irq-rda-intc.c
+++ b/drivers/irqchip/irq-rda-intc.c
@@ -85,8 +85,8 @@ static int __init rda8810_intc_init(struct device_node *node,
struct device_node *parent)
{
rda_intc_base = of_io_request_and_map(node, 0, "rda-intc");
- if (!rda_intc_base)
- return -ENXIO;
+ if (IS_ERR(rda_intc_base))
+ return PTR_ERR(rda_intc_base);
/* Mask all interrupt sources */
writel_relaxed(RDA_IRQ_MASK_ALL, rda_intc_base + RDA_INTC_MASK_CLR);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] irqchip: irq-rda-intc: Fix return value check in rda8810_intc_init()
2018-12-17 11:58 [PATCH -next] irqchip: irq-rda-intc: Fix return value check in rda8810_intc_init() Wei Yongjun
@ 2018-12-17 12:31 ` Manivannan Sadhasivam
0 siblings, 0 replies; 2+ messages in thread
From: Manivannan Sadhasivam @ 2018-12-17 12:31 UTC (permalink / raw)
To: Wei Yongjun
Cc: Thomas Gleixner, Jason Cooper, Marc Zyngier, linux-kernel,
kernel-janitors
On Mon, Dec 17, 2018 at 11:58:18AM +0000, Wei Yongjun wrote:
> 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: d852e62ad689 ("irqchip: Add RDA8810PL interrupt driver")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thanks,
Mani
> ---
> drivers/irqchip/irq-rda-intc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-rda-intc.c b/drivers/irqchip/irq-rda-intc.c
> index 1176291..9601683 100644
> --- a/drivers/irqchip/irq-rda-intc.c
> +++ b/drivers/irqchip/irq-rda-intc.c
> @@ -85,8 +85,8 @@ static int __init rda8810_intc_init(struct device_node *node,
> struct device_node *parent)
> {
> rda_intc_base = of_io_request_and_map(node, 0, "rda-intc");
> - if (!rda_intc_base)
> - return -ENXIO;
> + if (IS_ERR(rda_intc_base))
> + return PTR_ERR(rda_intc_base);
>
> /* Mask all interrupt sources */
> writel_relaxed(RDA_IRQ_MASK_ALL, rda_intc_base + RDA_INTC_MASK_CLR);
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-17 12:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-17 11:58 [PATCH -next] irqchip: irq-rda-intc: Fix return value check in rda8810_intc_init() Wei Yongjun
2018-12-17 12:31 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).