From: Axel Lin Date: Thu, 21 May 2015 14:57:34 +0000 (+0800) Subject: irqchip: mtk-sysirq: Make mtk_sysirq_of_init return error if ioremap fails X-Git-Tag: firefly_0821_release~176^2~1620^2~16 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e1a96fb861b0781c8ef66a76d0fc6fb6f628f84c;p=firefly-linux-kernel-4.4.55.git irqchip: mtk-sysirq: Make mtk_sysirq_of_init return error if ioremap fails PTR_ERR(NULL) returns 0 so current code returns 0 if ioremap fails, fix it. Signed-off-by: Axel Lin Reviewed-by: Matthias Brugger Cc: Yingjoe Chen Cc: linux-mediatek@lists.infradead.org Cc: Jason Cooper Link: http://lkml.kernel.org/r/1432220254.29544.1.camel@ingics.com Signed-off-by: Thomas Gleixner --- diff --git a/drivers/irqchip/irq-mtk-sysirq.c b/drivers/irqchip/irq-mtk-sysirq.c index 04de2d4ca70f..15c13039bba2 100644 --- a/drivers/irqchip/irq-mtk-sysirq.c +++ b/drivers/irqchip/irq-mtk-sysirq.c @@ -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; }