summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/lp8788_adc.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-01-31 21:43:00 +0000
committerJonathan Cameron <jic23@kernel.org>2013-02-02 12:02:20 +0000
commit6cb2afd7c0abb93bd9dc6d36b858b1e312e2407d (patch)
tree3abec8f4f092e6e594f4ce57069987c5618f67ff /drivers/iio/adc/lp8788_adc.c
parentca7d98dbd7db6aa8bc4b08e26be1249436d21af3 (diff)
iio: Simplify iio_map_array_unregister APIiio-for-3.9c
Instead of requiring the map to unregister, simply unregister all map entries associated with the given iio device. This simplifies map removal and also works for maps generated through devicetree. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc/lp8788_adc.c')
-rw-r--r--drivers/iio/adc/lp8788_adc.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/iio/adc/lp8788_adc.c b/drivers/iio/adc/lp8788_adc.c
index d02704ce0091..763f57565ee4 100644
--- a/drivers/iio/adc/lp8788_adc.c
+++ b/drivers/iio/adc/lp8788_adc.c
@@ -187,12 +187,6 @@ static int lp8788_iio_map_register(struct iio_dev *indio_dev,
return 0;
}
-static inline void lp8788_iio_map_unregister(struct iio_dev *indio_dev,
- struct lp8788_adc *adc)
-{
- iio_map_array_unregister(indio_dev, adc->map);
-}
-
static int lp8788_adc_probe(struct platform_device *pdev)
{
struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent);
@@ -231,7 +225,7 @@ static int lp8788_adc_probe(struct platform_device *pdev)
return 0;
err_iio_device:
- lp8788_iio_map_unregister(indio_dev, adc);
+ iio_map_array_unregister(indio_dev);
err_iio_map:
iio_device_free(indio_dev);
return ret;
@@ -240,10 +234,9 @@ err_iio_map:
static int lp8788_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
- struct lp8788_adc *adc = iio_priv(indio_dev);
iio_device_unregister(indio_dev);
- lp8788_iio_map_unregister(indio_dev, adc);
+ iio_map_array_unregister(indio_dev);
iio_device_free(indio_dev);
return 0;