irqchip: mtk-sysirq: Make mtk_sysirq_of_init return error if ioremap fails
authorAxel Lin <axel.lin@ingics.com>
Thu, 21 May 2015 14:57:34 +0000 (22:57 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 22 May 2015 09:06:47 +0000 (11:06 +0200)
PTR_ERR(NULL) returns 0 so current code returns 0 if ioremap fails, fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
Cc: linux-mediatek@lists.infradead.org <linux-mediatek@lists.infradead.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Link: http://lkml.kernel.org/r/1432220254.29544.1.camel@ingics.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/irqchip/irq-mtk-sysirq.c

index 04de2d4ca70fd724502ac1fd3fb2c300fa0c0cc4..15c13039bba211b53a309d05ba4fd0f333364065 100644 (file)
@@ -144,7 +144,7 @@ static int __init mtk_sysirq_of_init(struct device_node *node,
        chip_data->intpol_base = ioremap(res.start, size);
        if (!chip_data->intpol_base) {
                pr_err("mtk_sysirq: unable to map sysirq register\n");
-               ret = PTR_ERR(chip_data->intpol_base);
+               ret = -ENXIO;
                goto out_free;
        }