[tip:irq/core] irqchip: mtk-sysirq: Make mtk_sysirq_of_init return error if ioremap fails

From: tip-bot for Axel Lin
Date: Fri May 22 2015 - 05:13:29 EST


Commit-ID: e1a96fb861b0781c8ef66a76d0fc6fb6f628f84c
Gitweb: http://git.kernel.org/tip/e1a96fb861b0781c8ef66a76d0fc6fb6f628f84c
Author: Axel Lin <axel.lin@xxxxxxxxxx>
AuthorDate: Thu, 21 May 2015 22:57:34 +0800
Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitDate: Fri, 22 May 2015 11:06:47 +0200

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 <axel.lin@xxxxxxxxxx>
Reviewed-by: Matthias Brugger <matthias.bgg@xxxxxxxxx>
Cc: Yingjoe Chen <yingjoe.chen@xxxxxxxxxxxx>
Cc: linux-mediatek@xxxxxxxxxxxxxxxxxxx <linux-mediatek@xxxxxxxxxxxxxxxxxxx>
Cc: Jason Cooper <jason@xxxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/1432220254.29544.1.camel@xxxxxxxxxx
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
drivers/irqchip/irq-mtk-sysirq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-mtk-sysirq.c b/drivers/irqchip/irq-mtk-sysirq.c
index 04de2d4..15c1303 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;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/