lkml.org 
[lkml]   [2019]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] iio: max5481: use devres for iio device registration
Date
Replace iio_device_register with the devres variant and drop the
explicit function call to unregister the iio device.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/iio/potentiometer/max5481.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iio/potentiometer/max5481.c b/drivers/iio/potentiometer/max5481.c
index 732375b6d131..40b7212e68dc 100644
--- a/drivers/iio/potentiometer/max5481.c
+++ b/drivers/iio/potentiometer/max5481.c
@@ -162,7 +162,7 @@ static int max5481_probe(struct spi_device *spi)
if (ret < 0)
return ret;

- return iio_device_register(indio_dev);
+ return devm_iio_device_register(&spi->dev, indio_dev);
}

static int max5481_remove(struct spi_device *spi)
@@ -170,8 +170,6 @@ static int max5481_remove(struct spi_device *spi)
struct iio_dev *indio_dev = dev_get_drvdata(&spi->dev);
struct max5481_data *data = iio_priv(indio_dev);

- iio_device_unregister(indio_dev);
-
/* save wiper reg to NV reg */
return max5481_write_cmd(data, MAX5481_COPY_AB_TO_NV, 0);
}
--
2.11.0
\
 
 \ /
  Last update: 2019-08-14 11:23    [W:0.029 / U:21.636 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site