]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
irqchip/irq-rda-intc: Fix return value check in rda8810_intc_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 17 Dec 2018 11:58:18 +0000 (11:58 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Tue, 18 Dec 2018 12:55:23 +0000 (12:55 +0000)
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")
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-rda-intc.c

index 1176291fdef897d7549a8213dcf4ff1bd9da05cd..960168303b73b8ce02c6fa1ae91f879be8fafb26 100644 (file)
@@ -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);