LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [patch] irqchip: mtk-sysirq: fix an error code
@ 2015-01-30 8:28 Dan Carpenter
2015-02-04 13:17 ` Yingjoe Chen
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-01-30 8:28 UTC (permalink / raw)
To: Thomas Gleixner, Yingjoe Chen
Cc: Jason Cooper, Matthias Brugger, linux-kernel, linux-arm-kernel,
kernel-janitors
"chip_data->intpol_base" used to be an ERR_PTR() but we recently changed
it to be NULL. We need to update the error code as well because
"PTR_ERR(NULL)" means success where really we want to return -ENOMEM.
Fixes: cdb647a772e9 ('irqchip: mtk-sysirq: Get irq number from register resource size')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/irqchip/irq-mtk-sysirq.c b/drivers/irqchip/irq-mtk-sysirq.c
index eaf0a71..22eb34c 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 = -ENOMEM;
goto out_free;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] irqchip: mtk-sysirq: fix an error code
2015-01-30 8:28 [patch] irqchip: mtk-sysirq: fix an error code Dan Carpenter
@ 2015-02-04 13:17 ` Yingjoe Chen
0 siblings, 0 replies; 2+ messages in thread
From: Yingjoe Chen @ 2015-02-04 13:17 UTC (permalink / raw)
To: Dan Carpenter
Cc: Thomas Gleixner, Jason Cooper, Matthias Brugger, linux-kernel,
linux-arm-kernel, kernel-janitors, Eddie Huang
On Fri, 2015-01-30 at 11:28 +0300, Dan Carpenter wrote:
> "chip_data->intpol_base" used to be an ERR_PTR() but we recently changed
> it to be NULL. We need to update the error code as well because
> "PTR_ERR(NULL)" means success where really we want to return -ENOMEM.
>
> Fixes: cdb647a772e9 ('irqchip: mtk-sysirq: Get irq number from register resource size')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/irqchip/irq-mtk-sysirq.c b/drivers/irqchip/irq-mtk-sysirq.c
> index eaf0a71..22eb34c 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 = -ENOMEM;
> goto out_free;
> }
>
Dan,
Thanks for catching this.
Acked-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
I changed to use ioremap(), and remember to change the null pointer
check but not the return type. Sorry for the mistake.
Joe.C
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-04 13:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-30 8:28 [patch] irqchip: mtk-sysirq: fix an error code Dan Carpenter
2015-02-04 13:17 ` Yingjoe Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).