lkml.org 
[lkml]   [2019]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/4] iio: pressure: bmp280: use devm_iio_device_register()
Date
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We can use the managed variant of iio_device_register() and remove
the corresponding unregister operation from the remove callback.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
drivers/iio/pressure/bmp280-core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index c21f8ce7b09c..f22400e1e98f 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -1127,7 +1127,7 @@ int bmp280_common_probe(struct device *dev,
pm_runtime_use_autosuspend(dev);
pm_runtime_put(dev);

- ret = iio_device_register(indio_dev);
+ ret = devm_iio_device_register(dev, indio_dev);
if (ret)
goto out_runtime_pm_disable;

@@ -1149,7 +1149,6 @@ int bmp280_common_remove(struct device *dev)
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct bmp280_data *data = iio_priv(indio_dev);

- iio_device_unregister(indio_dev);
pm_runtime_get_sync(data->dev);
pm_runtime_put_noidle(data->dev);
pm_runtime_disable(data->dev);
--
2.23.0
\
 
 \ /
  Last update: 2019-10-02 10:59    [W:0.092 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site