summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/lp8788_adc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/adc/lp8788_adc.c')
-rw-r--r--drivers/iio/adc/lp8788_adc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/iio/adc/lp8788_adc.c b/drivers/iio/adc/lp8788_adc.c
index 62bc39e9c94f..5c8c91595f47 100644
--- a/drivers/iio/adc/lp8788_adc.c
+++ b/drivers/iio/adc/lp8788_adc.c
@@ -194,7 +194,7 @@ static int lp8788_adc_probe(struct platform_device *pdev)
struct lp8788_adc *adc;
int ret;
- indio_dev = iio_device_alloc(sizeof(*adc));
+ indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc));
if (!indio_dev)
return -ENOMEM;
@@ -205,7 +205,7 @@ static int lp8788_adc_probe(struct platform_device *pdev)
indio_dev->dev.of_node = pdev->dev.of_node;
ret = lp8788_iio_map_register(indio_dev, lp->pdata, adc);
if (ret)
- goto err_iio_map;
+ return ret;
mutex_init(&adc->lock);
@@ -226,8 +226,6 @@ static int lp8788_adc_probe(struct platform_device *pdev)
err_iio_device:
iio_map_array_unregister(indio_dev);
-err_iio_map:
- iio_device_free(indio_dev);
return ret;
}
@@ -237,7 +235,6 @@ static int lp8788_adc_remove(struct platform_device *pdev)
iio_device_unregister(indio_dev);
iio_map_array_unregister(indio_dev);
- iio_device_free(indio_dev);
return 0;
}