From: yingjoe.chen@mediatek.com (Yingjoe Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch] irqchip: mtk-sysirq: fix an error code
Date: Wed, 4 Feb 2015 21:17:17 +0800 [thread overview]
Message-ID: <1423055837.31210.29.camel@mtksdaap41> (raw)
In-Reply-To: <20150130082847.GB21357@mwanda>
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
prev parent reply other threads:[~2015-02-04 13:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-30 8:28 [patch] irqchip: mtk-sysirq: fix an error code Dan Carpenter
2015-02-04 13:17 ` Yingjoe Chen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423055837.31210.29.camel@mtksdaap41 \
--to=yingjoe.chen@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).