* [PATCH] staging: iio: adc: lpc32xx: use correct reutrn value
@ 2015-08-30 8:12 Peng Fan
2015-08-31 15:13 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan @ 2015-08-30 8:12 UTC (permalink / raw)
To: gregkh, jic23
Cc: linux-kernel, van.freenix, devel, linux-iio, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald, Tapasweni Pathak
To lpc32xx_adc driver, when platform_get_resource or
platform_get_irq failed, we should use -ENXIO as a
return value, but not -EBUSY.
Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Tapasweni Pathak <tapaswenipathak@gmail.com>
---
drivers/staging/iio/adc/lpc32xx_adc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/iio/adc/lpc32xx_adc.c b/drivers/staging/iio/adc/lpc32xx_adc.c
index 5331c44..bcf4ebb 100644
--- a/drivers/staging/iio/adc/lpc32xx_adc.c
+++ b/drivers/staging/iio/adc/lpc32xx_adc.c
@@ -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,
--
1.8.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: iio: adc: lpc32xx: use correct reutrn value
2015-08-30 8:12 [PATCH] staging: iio: adc: lpc32xx: use correct reutrn value Peng Fan
@ 2015-08-31 15:13 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2015-08-31 15:13 UTC (permalink / raw)
To: Peng Fan, gregkh
Cc: linux-kernel, devel, linux-iio, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald, Tapasweni Pathak
On 30/08/15 09:12, Peng Fan wrote:
> To lpc32xx_adc driver, when platform_get_resource or
> platform_get_irq failed, we should use -ENXIO as a
> return value, but not -EBUSY.
>
> Signed-off-by: Peng Fan <van.freenix@gmail.com>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Hartmut Knaack <knaack.h@gmx.de>
> Cc: Lars-Peter Clausen <lars@metafoo.de>
> Cc: Peter Meerwald <pmeerw@pmeerw.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Tapasweni Pathak <tapaswenipathak@gmail.com>
Applied to the togreg branch of iio.git - initially pushed out as testing for
the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/staging/iio/adc/lpc32xx_adc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/lpc32xx_adc.c b/drivers/staging/iio/adc/lpc32xx_adc.c
> index 5331c44..bcf4ebb 100644
> --- a/drivers/staging/iio/adc/lpc32xx_adc.c
> +++ b/drivers/staging/iio/adc/lpc32xx_adc.c
> @@ -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,
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-31 15:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-30 8:12 [PATCH] staging: iio: adc: lpc32xx: use correct reutrn value Peng Fan
2015-08-31 15:13 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.