lkml.org 
[lkml]   [2022]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 02/10] iio: adc: mcp3911: use resource-managed version of iio_device_register
Date
Keep using managed resources as much as possible.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
drivers/iio/adc/mcp3911.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c
index 4338552cd0ca..3d9e8ed10874 100644
--- a/drivers/iio/adc/mcp3911.c
+++ b/drivers/iio/adc/mcp3911.c
@@ -306,7 +306,7 @@ static int mcp3911_probe(struct spi_device *spi)

mutex_init(&adc->lock);

- ret = iio_device_register(indio_dev);
+ ret = devm_iio_device_register(&adc->spi->dev, indio_dev);
if (ret)
goto clk_disable;

@@ -326,8 +326,6 @@ static void mcp3911_remove(struct spi_device *spi)
struct iio_dev *indio_dev = spi_get_drvdata(spi);
struct mcp3911 *adc = iio_priv(indio_dev);

- iio_device_unregister(indio_dev);
-
clk_disable_unprepare(adc->clki);
if (adc->vref)
regulator_disable(adc->vref);
--
2.36.1
\
 
 \ /
  Last update: 2022-06-23 19:41    [W:0.599 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site