linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] iio: adc: vf610: Propagate the real error when platform_get_irq() fails
@ 2014-10-03  1:25 Fabio Estevam
  2014-10-03  1:25 ` [PATCH 2/5] iio: adc: vf610: Return the error code directly Fabio Estevam
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Fabio Estevam @ 2014-10-03  1:25 UTC (permalink / raw)
  To: jic23; +Cc: B38611, linux-iio, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

There is no need to pass a 'fake' return value when platform_get_irq() fails.

Propagate the real error instead. 

While at it, only consider negative numbers returned by platform_get_irq()
as error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/iio/adc/vf610_adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
index 4a10ae9..c259901 100644
--- a/drivers/iio/adc/vf610_adc.c
+++ b/drivers/iio/adc/vf610_adc.c
@@ -569,9 +569,9 @@ static int vf610_adc_probe(struct platform_device *pdev)
 		return PTR_ERR(info->regs);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
+	if (irq < 0) {
 		dev_err(&pdev->dev, "no irq resource?\n");
-		return -EINVAL;
+		return irq;
 	}
 
 	ret = devm_request_irq(info->dev, irq,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-10-10 23:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-03  1:25 [PATCH 1/5] iio: adc: vf610: Propagate the real error when platform_get_irq() fails Fabio Estevam
2014-10-03  1:25 ` [PATCH 2/5] iio: adc: vf610: Return the error code directly Fabio Estevam
2014-10-04 11:28   ` Jonathan Cameron
2014-10-03  1:25 ` [PATCH 3/5] iio: adc: vf610: Disable the regulator on error Fabio Estevam
2014-10-04 11:30   ` Jonathan Cameron
2014-10-03  1:25 ` [PATCH 4/5] iio: adc: vf610: SIMPLE_DEV_PM_OPS can fit on a single line Fabio Estevam
2014-10-04 11:31   ` Jonathan Cameron
2014-10-03  1:25 ` [PATCH 5/5] iio: adc: vf610: Remove CONFIG_PM_SLEEP ifdef's Fabio Estevam
2014-10-04 11:34   ` Jonathan Cameron
2014-10-04 11:26 ` [PATCH 1/5] iio: adc: vf610: Propagate the real error when platform_get_irq() fails Jonathan Cameron
2014-10-04 18:46   ` Fabio Estevam
2014-10-09 19:57     ` Jonathan Cameron
2014-10-09 19:59     ` Jonathan Cameron

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).