linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Phil Reid <preid@electromag.com.au>
Cc: Stephen Boyd <swboyd@chromium.org>,
	linux-kernel@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v6 19/57] iio: Remove dev_err() usage after platform_get_irq()
Date: Mon, 5 Aug 2019 16:01:00 +0100	[thread overview]
Message-ID: <20190805160100.7f1b92be@archlinux> (raw)
In-Reply-To: <6dc9dbc0-c338-eb21-aeb3-70026bebfd41@electromag.com.au>

On Thu, 1 Aug 2019 10:37:40 +0800
Phil Reid <preid@electromag.com.au> wrote:

> G'day Stephen,
> 
> One comment below.

Please send as fresh patch. Nice to clean these up, but I'll loose it
buried in a thread like this!

Thanks,

Jonathan

> 
> On 31/07/2019 22:32, Stephen Boyd wrote:
> > Quoting Phil Reid (2019-07-30 23:42:16)  
> >> G'day Stephen,
> >>
> >> A comment unrelated to your change.
> >>
> >> On 31/07/2019 02:15, Stephen Boyd wrote:
> >> ....
> >>  
> >>> diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
> >>> index 32f1c4a33b20..abe99856c823 100644
> >>> --- a/drivers/iio/adc/at91_adc.c
> >>> +++ b/drivers/iio/adc/at91_adc.c
> >>> @@ -1179,10 +1179,8 @@ static int at91_adc_probe(struct platform_device *pdev)
> >>>        idev->info = &at91_adc_info;
> >>>    
> >>>        st->irq = platform_get_irq(pdev, 0);
> >>> -     if (st->irq < 0) {
> >>> -             dev_err(&pdev->dev, "No IRQ ID is designated\n");
> >>> +     if (st->irq < 0)
> >>>                return -ENODEV;  
> >> Should this be returning st->irq instead of -ENODEV?
> >> eg: platform_get_irq can return -EPROBE_DEFER
> >>
> >> Pattern is repeated in a number of other places.  
> > 
> > Probably? Here's a patch.
> > 
> > ----8<----
> > From: Stephen Boyd <swboyd@chromium.org>
> > Subject: [PATCH] iio: Return error values from platform_get_irq*()
> > 
> > Sometimes platform_get_irq*() can return -EPROBE_DEFER, so it's best to
> > return the actual error value from calling this function instead of
> > overriding the value to something like -EINVAL or -ENXIO. Except for in
> > the case when the irq value is 0 and the driver knows that irq 0 isn't
> > valid. In such a situation, return whatever error value was returned
> > before this change.
> > 
> > Reported-by: Phil Reid <preid@electromag.com.au>
> > Cc: Phil Reid <preid@electromag.com.au>
> > Cc: Jonathan Cameron <jic23@kernel.org>
> > Cc: Hartmut Knaack <knaack.h@gmx.de>
> > Cc: Lars-Peter Clausen <lars@metafoo.de>
> > Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
> > Cc: linux-iio@vger.kernel.org
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> > ---
> >   drivers/iio/adc/at91_adc.c      | 2 +-
> >   drivers/iio/adc/bcm_iproc_adc.c | 2 +-
> >   drivers/iio/adc/fsl-imx25-gcq.c | 4 +---
> >   drivers/iio/adc/lpc32xx_adc.c   | 2 +-
> >   drivers/iio/adc/npcm_adc.c      | 2 +-
> >   drivers/iio/adc/spear_adc.c     | 2 +-
> >   6 files changed, 6 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
> > index abe99856c823..2c604198c4b7 100644
> > --- a/drivers/iio/adc/at91_adc.c
> > +++ b/drivers/iio/adc/at91_adc.c
> > @@ -1180,7 +1180,7 @@ static int at91_adc_probe(struct platform_device *pdev)
> >   
> >   	st->irq = platform_get_irq(pdev, 0);
> >   	if (st->irq < 0)
> > -		return -ENODEV;
> > +		return st->irq;
> >   
> >   	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> >   
> > diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c
> > index 646ebdc0a8b4..6c05ea510c40 100644
> > --- a/drivers/iio/adc/bcm_iproc_adc.c
> > +++ b/drivers/iio/adc/bcm_iproc_adc.c
> > @@ -541,7 +541,7 @@ static int iproc_adc_probe(struct platform_device *pdev)
> >   
> >   	adc_priv->irqno = platform_get_irq(pdev, 0);
> >   	if (adc_priv->irqno <= 0)
> > -		return -ENODEV;
> > +		return adc_priv->irqno;  
> 
> 		return adc_priv->irqno ? : -ENODEV;
> 
> >   
> >   	ret = regmap_update_bits(adc_priv->regmap, IPROC_REGCTL2,
> >   				IPROC_ADC_AUXIN_SCAN_ENA, 0);
> > diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
> > index fa71489195c6..ee20ab09abe5 100644
> > --- a/drivers/iio/adc/fsl-imx25-gcq.c
> > +++ b/drivers/iio/adc/fsl-imx25-gcq.c
> > @@ -340,9 +340,7 @@ static int mx25_gcq_probe(struct platform_device *pdev)
> >   
> >   	priv->irq = platform_get_irq(pdev, 0);
> >   	if (priv->irq <= 0) {
> > -		ret = priv->irq;
> > -		if (!ret)
> > -			ret = -ENXIO;
> > +		ret = priv->irq ? : -ENXIO;
> >   		goto err_clk_unprepare;
> >   	}
> >   
> > diff --git a/drivers/iio/adc/lpc32xx_adc.c b/drivers/iio/adc/lpc32xx_adc.c
> > index b896f7ff4572..edbb58212fba 100644
> > --- a/drivers/iio/adc/lpc32xx_adc.c
> > +++ b/drivers/iio/adc/lpc32xx_adc.c
> > @@ -173,7 +173,7 @@ static int lpc32xx_adc_probe(struct platform_device *pdev)
> >   
> >   	irq = platform_get_irq(pdev, 0);
> >   	if (irq <= 0)
> > -		return -ENXIO;
> > +		return irq ? : -ENXIO;
> >   
> >   	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 910f3585fa54..1e54a64a4534 100644
> > --- a/drivers/iio/adc/npcm_adc.c
> > +++ b/drivers/iio/adc/npcm_adc.c
> > @@ -225,7 +225,7 @@ static int npcm_adc_probe(struct platform_device *pdev)
> >   
> >   	irq = platform_get_irq(pdev, 0);
> >   	if (irq <= 0) {
> > -		ret = -EINVAL;
> > +		ret = irq ? : -EINVAL;
> >   		goto err_disable_clk;
> >   	}
> >   
> > diff --git a/drivers/iio/adc/spear_adc.c b/drivers/iio/adc/spear_adc.c
> > index 592b97c464da..9b16717ac7e7 100644
> > --- a/drivers/iio/adc/spear_adc.c
> > +++ b/drivers/iio/adc/spear_adc.c
> > @@ -301,7 +301,7 @@ static int spear_adc_probe(struct platform_device *pdev)
> >   
> >   	irq = platform_get_irq(pdev, 0);
> >   	if (irq <= 0) {
> > -		ret = -EINVAL;
> > +		ret = irq ? : -EINVAL;
> >   		goto errout2;
> >   	}
> >   
> >   
> 
> 


  reply	other threads:[~2019-08-05 15:01 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 18:15 [PATCH v6 00/57] Add error message to platform_get_irq*() Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 01/57] ata: Remove dev_err() usage after platform_get_irq() Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 02/57] bus: sunxi-rsb: " Stephen Boyd
2019-08-05  3:35   ` Chen-Yu Tsai
2019-08-05 20:44     ` Stephen Boyd
2019-08-06  6:20       ` Chen-Yu Tsai
2019-07-30 18:15 ` [PATCH v6 03/57] hwrng: " Stephen Boyd
2019-08-09  6:17   ` Herbert Xu
2019-07-30 18:15 ` [PATCH v6 04/57] clocksource: " Stephen Boyd
2019-08-08  7:47   ` Geert Uytterhoeven
2019-08-09  6:56   ` Daniel Lezcano
2019-07-30 18:15 ` [PATCH v6 05/57] crypto: " Stephen Boyd
2019-08-09  6:17   ` Herbert Xu
2019-07-30 18:15 ` [PATCH v6 06/57] cpufreq: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 07/57] ARM: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 08/57] MIPS: " Stephen Boyd
2019-08-26 11:05   ` Paul Burton
2019-07-30 18:15 ` [PATCH v6 09/57] devfreq: " Stephen Boyd
2019-07-31  0:21   ` Chanwoo Choi
2019-07-30 18:15 ` [PATCH v6 10/57] dmaengine: " Stephen Boyd
2019-07-31 15:28   ` Vinod Koul
2019-07-30 18:15 ` [PATCH v6 11/57] edac: " Stephen Boyd
2019-08-02 17:04   ` James Morse
2019-07-30 18:15 ` [PATCH v6 12/57] extcon: " Stephen Boyd
2019-07-31  0:20   ` Chanwoo Choi
2019-07-30 18:15 ` [PATCH v6 13/57] firmware: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 14/57] fpga: " Stephen Boyd
2019-08-31 20:55   ` Moritz Fischer
2019-07-30 18:15 ` [PATCH v6 15/57] gpio: " Stephen Boyd
2019-07-31  7:28   ` Bartosz Golaszewski
2019-08-05 11:26   ` Linus Walleij
2019-07-30 18:15 ` [PATCH v6 16/57] HSI: " Stephen Boyd
2019-07-30 20:44   ` Sebastian Reichel
2019-07-30 18:15 ` [PATCH v6 17/57] hwmon: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 18/57] i2c: " Stephen Boyd
2019-07-31 14:30   ` Wolfram Sang
2019-07-31 14:46     ` Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 19/57] iio: " Stephen Boyd
2019-07-31  6:42   ` Phil Reid
2019-07-31 14:32     ` Stephen Boyd
2019-08-01  2:37       ` Phil Reid
2019-08-05 15:01         ` Jonathan Cameron [this message]
2019-08-05 15:00   ` Jonathan Cameron
2019-07-30 18:15 ` [PATCH v6 20/57] infiniband: " Stephen Boyd
2019-07-31 15:53   ` Doug Ledford
2019-07-30 18:15 ` [PATCH v6 21/57] Input: " Stephen Boyd
2019-08-14 17:48   ` Dmitry Torokhov
2019-07-30 18:15 ` [PATCH v6 22/57] iommu: " Stephen Boyd
2019-08-09 15:33   ` Joerg Roedel
2019-07-30 18:15 ` [PATCH v6 23/57] irqchip: " Stephen Boyd
2019-08-07 14:23   ` Marc Zyngier
2019-07-30 18:15 ` [PATCH v6 24/57] mailbox: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 25/57] media: " Stephen Boyd
2019-08-08  7:56   ` Geert Uytterhoeven
2019-07-30 18:15 ` [PATCH v6 26/57] memory: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 27/57] mfd: " Stephen Boyd
2019-08-12  9:39   ` Lee Jones
2019-07-30 18:15 ` [PATCH v6 28/57] pcie-gadget-spear: " Stephen Boyd
2019-07-30 18:29   ` Arnd Bergmann
2019-07-31 14:16     ` Stephen Boyd
2019-08-05 16:05       ` Greg Kroah-Hartman
2019-07-30 18:15 ` [PATCH v6 29/57] mmc: " Stephen Boyd
2019-08-02 15:16   ` Ulf Hansson
2019-08-08  7:58   ` Geert Uytterhoeven
2019-07-30 18:15 ` [PATCH v6 30/57] mtd: " Stephen Boyd
2019-10-08 17:25   ` Miquel Raynal
2019-07-30 18:15 ` [PATCH v6 31/57] pci: " Stephen Boyd
2019-07-30 21:56   ` Bjorn Helgaas
2019-08-07 14:09     ` Marc Gonzalez
2019-08-07 22:08       ` Bjorn Helgaas
2019-08-08  8:02   ` Geert Uytterhoeven
2019-08-10  8:20   ` Linus Walleij
2019-07-30 18:15 ` [PATCH v6 32/57] perf: " Stephen Boyd
2019-07-31  8:40   ` Will Deacon
2019-07-31 14:07     ` Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 33/57] pinctrl: " Stephen Boyd
2019-08-05 11:24   ` Linus Walleij
2019-07-30 18:15 ` [PATCH v6 34/57] pinctrl: intel: " Stephen Boyd
2019-07-30 18:32   ` Andy Shevchenko
2019-08-01 13:57   ` Andy Shevchenko
2019-07-30 18:15 ` [PATCH v6 35/57] power: supply: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 36/57] pwm: " Stephen Boyd
2019-07-31  6:58   ` Uwe Kleine-König
2019-07-31  7:13     ` Greg Kroah-Hartman
2019-07-31  7:39       ` Uwe Kleine-König
2019-07-30 18:15 ` [PATCH v6 37/57] regulator: " Stephen Boyd
2019-08-02 11:22   ` Applied "regulator: Remove dev_err() usage after platform_get_irq()" to the regulator tree Mark Brown
2019-07-30 18:15 ` [PATCH v6 38/57] remoteproc: Remove dev_err() usage after platform_get_irq() Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 39/57] rtc: " Stephen Boyd
2019-08-08  8:05   ` Geert Uytterhoeven
2019-08-13  8:53   ` Alexandre Belloni
2019-07-30 18:15 ` [PATCH v6 40/57] soc: " Stephen Boyd
2019-07-30 18:35   ` Bjorn Andersson
2019-07-30 21:26     ` Leo Li
2019-07-30 21:36       ` Stephen Boyd
2019-07-31 18:50         ` Li Yang
2019-07-30 21:36     ` [PATCH v7 1/2] soc: fsl: qbman: " Stephen Boyd
2019-07-30 21:36     ` [PATCH v7 2/2] soc: qcom: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 41/57] spi: " Stephen Boyd
2019-08-02 11:22   ` Applied "spi: Remove dev_err() usage after platform_get_irq()" to the spi tree Mark Brown
2019-08-08  8:09   ` [PATCH v6 41/57] spi: Remove dev_err() usage after platform_get_irq() Geert Uytterhoeven
2019-07-30 18:15 ` [PATCH v6 42/57] staging: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 43/57] thermal: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 44/57] tty: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 45/57] uio: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 46/57] usb: " Stephen Boyd
2019-08-08 12:40   ` Felipe Balbi
2019-07-30 18:15 ` [PATCH v6 47/57] video: " Stephen Boyd
2020-01-03 11:29   ` Bartlomiej Zolnierkiewicz
2019-07-30 18:15 ` [PATCH v6 48/57] watchdog: " Stephen Boyd
2019-07-30 18:41   ` Guenter Roeck
2019-07-30 18:15 ` [PATCH v6 49/57] ASoC: " Stephen Boyd
2019-08-02 11:21   ` Applied "ASoC: Remove dev_err() usage after platform_get_irq()" to the asoc tree Mark Brown
2019-07-30 18:15 ` [PATCH v6 50/57] gpu: Remove dev_err() usage after platform_get_irq() Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 51/57] net: " Stephen Boyd
2019-07-30 21:25   ` David Miller
2019-07-30 18:15 ` [PATCH v6 52/57] platform/x86: intel_pmc_ipc: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 53/57] platform/mellanox: mlxreg-hotplug: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 54/57] platform/x86: intel_bxtwc_tmu: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 55/57] platform/x86: intel_int0002_vgpio: " Stephen Boyd
2019-08-01 15:11   ` Andy Shevchenko
2019-07-30 18:15 ` [PATCH v6 56/57] scsi: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 57/57] ALSA: x86: " Stephen Boyd
2019-07-31  8:23 ` [PATCH v6 00/57] Add error message to platform_get_irq*() Markus Elfring

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=20190805160100.7f1b92be@archlinux \
    --to=jic23@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=preid@electromag.com.au \
    --cc=swboyd@chromium.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).