From: Jonathan Cameron <jic23@kernel.org>
To: Ruan Jinjie <ruanjinjie@huawei.com>
Cc: <lars@metafoo.de>, <rjui@broadcom.com>, <sbranden@broadcom.com>,
<bcm-kernel-feedback-list@broadcom.com>, <vz@mleia.com>,
<avifishman70@gmail.com>, <tmaimon77@gmail.com>,
<tali.perry1@gmail.com>, <venture@google.com>, <yuenn@google.com>,
<benjaminfair@google.com>, <nuno.sa@analog.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-iio@vger.kernel.org>, <linux-rockchip@lists.infradead.org>,
<openbmc@lists.ozlabs.org>
Subject: Re: [PATCH -next] iio: adc: fix the return value handle for platform_get_irq()
Date: Sat, 29 Jul 2023 16:24:30 +0100 [thread overview]
Message-ID: <20230729162430.4f858e08@jic23-huawei> (raw)
In-Reply-To: <20230727131607.2897937-1-ruanjinjie@huawei.com>
On Thu, 27 Jul 2023 21:16:07 +0800
Ruan Jinjie <ruanjinjie@huawei.com> wrote:
> There is no possible for platform_get_irq() to return 0
> and the return value of platform_get_irq() is more sensible
> to show the error reason.
>
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Applied.
Thanks,
Jonathan
> ---
> drivers/iio/adc/bcm_iproc_adc.c | 4 ++--
> drivers/iio/adc/lpc32xx_adc.c | 4 ++--
> drivers/iio/adc/npcm_adc.c | 4 ++--
> drivers/iio/adc/spear_adc.c | 4 ++--
> 4 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c
> index 44e1e53ada72..0d6885413a7e 100644
> --- a/drivers/iio/adc/bcm_iproc_adc.c
> +++ b/drivers/iio/adc/bcm_iproc_adc.c
> @@ -540,8 +540,8 @@ static int iproc_adc_probe(struct platform_device *pdev)
> }
>
> adc_priv->irqno = platform_get_irq(pdev, 0);
> - if (adc_priv->irqno <= 0)
> - return -ENODEV;
> + if (adc_priv->irqno < 0)
> + return adc_priv->irqno;
>
> ret = regmap_update_bits(adc_priv->regmap, IPROC_REGCTL2,
> IPROC_ADC_AUXIN_SCAN_ENA, 0);
> diff --git a/drivers/iio/adc/lpc32xx_adc.c b/drivers/iio/adc/lpc32xx_adc.c
> index 732c924a976d..e34ed7dacd89 100644
> --- a/drivers/iio/adc/lpc32xx_adc.c
> +++ b/drivers/iio/adc/lpc32xx_adc.c
> @@ -176,8 +176,8 @@ static int lpc32xx_adc_probe(struct platform_device *pdev)
> }
>
> irq = platform_get_irq(pdev, 0);
> - if (irq <= 0)
> - return -ENXIO;
> + if (irq < 0)
> + return irq;
>
> retval = devm_request_irq(&pdev->dev, irq, lpc32xx_adc_isr, 0,
> LPC32XXAD_NAME, st);
> diff --git a/drivers/iio/adc/npcm_adc.c b/drivers/iio/adc/npcm_adc.c
> index ba4cd8f49f66..3d9207c160eb 100644
> --- a/drivers/iio/adc/npcm_adc.c
> +++ b/drivers/iio/adc/npcm_adc.c
> @@ -244,8 +244,8 @@ static int npcm_adc_probe(struct platform_device *pdev)
> info->adc_sample_hz = clk_get_rate(info->adc_clk) / ((div + 1) * 2);
>
> irq = platform_get_irq(pdev, 0);
> - if (irq <= 0) {
> - ret = -EINVAL;
> + if (irq < 0) {
> + ret = irq;
> goto err_disable_clk;
> }
>
> diff --git a/drivers/iio/adc/spear_adc.c b/drivers/iio/adc/spear_adc.c
> index d93e580b3dc5..ad54ef798109 100644
> --- a/drivers/iio/adc/spear_adc.c
> +++ b/drivers/iio/adc/spear_adc.c
> @@ -310,8 +310,8 @@ static int spear_adc_probe(struct platform_device *pdev)
> }
>
> irq = platform_get_irq(pdev, 0);
> - if (irq <= 0) {
> - ret = -EINVAL;
> + if (irq < 0) {
> + ret = irq;
> goto errout2;
> }
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-07-29 15:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 13:16 [PATCH -next] iio: adc: fix the return value handle for platform_get_irq() Ruan Jinjie
2023-07-29 15:24 ` Jonathan Cameron [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=20230729162430.4f858e08@jic23-huawei \
--to=jic23@kernel.org \
--cc=avifishman70@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=benjaminfair@google.com \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=nuno.sa@analog.com \
--cc=openbmc@lists.ozlabs.org \
--cc=rjui@broadcom.com \
--cc=ruanjinjie@huawei.com \
--cc=sbranden@broadcom.com \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=vz@mleia.com \
--cc=yuenn@google.com \
/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