diff options
author | Lars-Peter Clausen | 2016-10-19 19:07:04 +0200 |
---|---|---|
committer | Jonathan Cameron | 2016-10-23 20:34:16 +0200 |
commit | 71faca73af90df461c2cb3fccaefcf06793ab99f (patch) | |
tree | 7c152549f1ad580fdeb6678c92dd081d2d39f51a /drivers/staging/iio/adc/ad7606_par.c | |
parent | staging:iio:ad7606: Move set_drvdata() into common code (diff) | |
download | kernel-qcow2-linux-71faca73af90df461c2cb3fccaefcf06793ab99f.tar.gz kernel-qcow2-linux-71faca73af90df461c2cb3fccaefcf06793ab99f.tar.xz kernel-qcow2-linux-71faca73af90df461c2cb3fccaefcf06793ab99f.zip |
staging:iio:ad7606: Let the common probe function return int
The common probe function for the ad7606 currently returns a struct iio_dev
pointer. The returned value is not used by the individual driver probe
functions other than for error checking.
Let the common probe function return a int instead to report the error
value directly (or 0 on success). This allows to simplify the code.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/adc/ad7606_par.c')
-rw-r--r-- | drivers/staging/iio/adc/ad7606_par.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/staging/iio/adc/ad7606_par.c b/drivers/staging/iio/adc/ad7606_par.c index c273993a7f2e..42eb9e0cae1a 100644 --- a/drivers/staging/iio/adc/ad7606_par.c +++ b/drivers/staging/iio/adc/ad7606_par.c @@ -51,7 +51,6 @@ static int ad7606_par_probe(struct platform_device *pdev) { const struct platform_device_id *id = platform_get_device_id(pdev); struct resource *res; - struct iio_dev *indio_dev; void __iomem *addr; resource_size_t remap_size; int irq; @@ -69,15 +68,10 @@ static int ad7606_par_probe(struct platform_device *pdev) remap_size = resource_size(res); - indio_dev = ad7606_probe(&pdev->dev, irq, addr, - id->name, id->driver_data, - remap_size > 1 ? &ad7606_par16_bops : - &ad7606_par8_bops); - - if (IS_ERR(indio_dev)) - return PTR_ERR(indio_dev); - - return 0; + return ad7606_probe(&pdev->dev, irq, addr, + id->name, id->driver_data, + remap_size > 1 ? &ad7606_par16_bops : + &ad7606_par8_bops); } static int ad7606_par_remove(struct platform_device *pdev) |