Skip to contentSkip to conversation

staging: iio: adc: lpc32xx: use correct reutrn value

PATCH In review Peng Fan 2 participants 2 messages Aug 30, 2015 – Aug 31, 2015

Subsystems (4)
lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 staging: iio: adc: lpc32xx: use correct reutrn value

To lpc32xx_adc driver, when platform_get_resource or platform_get_irq failed, we should use -ENXIO as a return value, but not -EBUSY.

Cc Jonathan Cameron <[email protected]>
Cc Hartmut Knaack <[email protected]>
Cc Lars-Peter Clausen <[email protected]>
Cc Peter Meerwald <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Tapasweni Pathak <[email protected]>
---
 drivers/staging/iio/adc/lpc32xx_adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/iio/adc/lpc32xx_adc.c +2 -2
index 5331c44..bcf4ebb 100644
@@ -137,7 +137,7 @@ static int lpc32xx_adc_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
 		dev_err(&pdev->dev, "failed to get platform I/O memory\n");
-		return -EBUSY;
+		return -ENXIO;
 	}
 
 	iodev = devm_iio_device_alloc(&pdev->dev, sizeof(*info));
@@ -162,7 +162,7 @@ static int lpc32xx_adc_probe(struct platform_device *pdev)
 	irq = platform_get_irq(pdev, 0);
 	if (irq <= 0) {
 		dev_err(&pdev->dev, "failed getting interrupt resource\n");
-		return -EINVAL;
+		return -ENXIO;
 	}
 
 	retval = devm_request_irq(&pdev->dev, irq, lpc32xx_adc_isr, 0,
Signature · 1 line
1.8.4
maintainer
#1 lore raw
Quoted 11 lines · Peng Fan

To lpc32xx_adc driver, when platform_get_resource or platform_get_irq failed, we should use -ENXIO as a return value, but not -EBUSY.

Cc Jonathan Cameron <[email protected]>
Cc Hartmut Knaack <[email protected]>
Cc Lars-Peter Clausen <[email protected]>
Cc Peter Meerwald <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Tapasweni Pathak <[email protected]>

Applied to the togreg branch of iio.git - initially pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 27 lines
---
 drivers/staging/iio/adc/lpc32xx_adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/iio/adc/lpc32xx_adc.c +2 -2
index 5331c44..bcf4ebb 100644
@@ -137,7 +137,7 @@ static int lpc32xx_adc_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
 		dev_err(&pdev->dev, "failed to get platform I/O memory\n");
-		return -EBUSY;
+		return -ENXIO;
 	}
 
 	iodev = devm_iio_device_alloc(&pdev->dev, sizeof(*info));
@@ -162,7 +162,7 @@ static int lpc32xx_adc_probe(struct platform_device *pdev)
 	irq = platform_get_irq(pdev, 0);
 	if (irq <= 0) {
 		dev_err(&pdev->dev, "failed getting interrupt resource\n");
-		return -EINVAL;
+		return -ENXIO;
 	}
 
 	retval = devm_request_irq(&pdev->dev, irq, lpc32xx_adc_isr, 0,