diff mbox

irqchip: irq-mtk-sysirq: Make mtk_sysirq_of_init return error if ioremap fails

Message ID 1432220254.29544.1.camel@ingics.com (mailing list archive)
State New, archived
Headers show

Commit Message

Axel Lin May 21, 2015, 2:57 p.m. UTC
PTR_ERR(NULL) returns 0 so current code returns 0 if ioremap fails, fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/irqchip/irq-mtk-sysirq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthias Brugger May 21, 2015, 3:36 p.m. UTC | #1
2015-05-21 16:57 GMT+02:00 Axel Lin <axel.lin@ingics.com>:
> 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>
diff mbox

Patch

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;
 	}