All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: [PATCH 2/4] iio: pressure: bmp280: use devm_iio_device_register()
Date: Wed,  2 Oct 2019 10:57:57 +0200	[thread overview]
Message-ID: <20191002085759.13337-3-brgl@bgdev.pl> (raw)
In-Reply-To: <20191002085759.13337-1-brgl@bgdev.pl>

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


  parent reply	other threads:[~2019-10-02  8:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02  8:57 [PATCH 0/4] iio: pressure: bmp280: code shrink Bartosz Golaszewski
2019-10-02  8:57 ` [PATCH 1/4] iio: pressure: bmp280: use bulk regulator ops Bartosz Golaszewski
2019-10-02 13:06   ` kbuild test robot
2019-10-02 13:06     ` kbuild test robot
2019-10-02 15:57     ` Bartosz Golaszewski
2019-10-06  9:49       ` Jonathan Cameron
2019-10-06  9:49         ` Jonathan Cameron
2019-10-22 10:03         ` Jonathan Cameron
2019-10-22 10:03           ` Jonathan Cameron
2019-10-06  9:50   ` Jonathan Cameron
2019-10-02  8:57 ` Bartosz Golaszewski [this message]
2019-10-06  9:56   ` [PATCH 2/4] iio: pressure: bmp280: use devm_iio_device_register() Jonathan Cameron
2019-10-02  8:57 ` [PATCH 3/4] iio: pressure: bmp280: remove stray newline Bartosz Golaszewski
2019-10-06  9:57   ` Jonathan Cameron
2019-10-02  8:57 ` [PATCH 4/4] iio: pressure: bmp280: use devm action and remove labels from probe Bartosz Golaszewski
2019-10-06  9:58   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191002085759.13337-3-brgl@bgdev.pl \
    --to=brgl@bgdev.pl \
    --cc=bgolaszewski@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.