summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/adc/ad7606_core.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2016-10-19 19:07:05 +0200
committerJonathan Cameron <jic23@kernel.org>2016-10-23 19:34:16 +0100
commita866058f8e40a30c62027990c91aa71008617207 (patch)
tree0c1d8d3dfbb2f44d569075798ea57c5a856d10d0 /drivers/staging/iio/adc/ad7606_core.c
parent71faca73af90df461c2cb3fccaefcf06793ab99f (diff)
downloadlinux-a866058f8e40a30c62027990c91aa71008617207.tar.bz2
staging:iio:ad7606: Let common remove function take a struct device *
Currently the common remove function takes a struct iio_dev *. This parameter is retrieved by the individual driver remove functions by calling get_drvdata() on their device. To simplify the code let the common remove function directly take a struct dev * and do the IIO device in retrieval the common remove function. This also aligns the interface with the common probe function. 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_core.c')
-rw-r--r--drivers/staging/iio/adc/ad7606_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c
index 1ee7a290cf4d..670caa2d3343 100644
--- a/drivers/staging/iio/adc/ad7606_core.c
+++ b/drivers/staging/iio/adc/ad7606_core.c
@@ -535,8 +535,9 @@ error_disable_reg:
}
EXPORT_SYMBOL_GPL(ad7606_probe);
-int ad7606_remove(struct iio_dev *indio_dev, int irq)
+int ad7606_remove(struct device *dev, int irq)
{
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7606_state *st = iio_priv(indio_dev);
iio_device_unregister(indio_dev);