From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH] power: supply: cpcap-battery: Fix platform_get_irq_byname's error checking
Date: Fri, 1 Dec 2017 16:30:44 +0100 [thread overview]
Message-ID: <20171201153044.syty3b37rnjciqte@earth> (raw)
In-Reply-To: <638d9bb5ac4c0ef44d3e83cc0f74d6e80cddcf7d.1511542695.git.arvind.yadav.cs@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]
Hi,
On Fri, Nov 24, 2017 at 10:31:40PM +0530, Arvind Yadav wrote:
> The platform_get_irq_byname() function returns -1 if an error occurs.
> zero or positive number on success. platform_get_irq_byname() error
> checking for zero is not correct.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
Thanks, queued.
-- Sebastian
> drivers/power/supply/cpcap-battery.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
> index ee71a2b..98ba078 100644
> --- a/drivers/power/supply/cpcap-battery.c
> +++ b/drivers/power/supply/cpcap-battery.c
> @@ -586,8 +586,8 @@ static int cpcap_battery_init_irq(struct platform_device *pdev,
> int irq, error;
>
> irq = platform_get_irq_byname(pdev, name);
> - if (!irq)
> - return -ENODEV;
> + if (irq < 0)
> + return irq;
>
> error = devm_request_threaded_irq(ddata->dev, irq, NULL,
> cpcap_battery_irq_thread,
> --
> 2.7.4
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2017-12-01 15:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-24 17:01 [PATCH] power: supply: cpcap-battery: Fix platform_get_irq_byname's error checking Arvind Yadav
2017-12-01 15:30 ` Sebastian Reichel [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=20171201153044.syty3b37rnjciqte@earth \
--to=sebastian.reichel@collabora.co.uk \
--cc=arvind.yadav.cs@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.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