public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Erikas Bitovtas <xerikasxx@gmail.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Erikas Bitovtas <xerikasxx@gmail.com>
Subject: [PATCH 3/3] iio: light: vcnl4000: register an IIO device with a device-managed function
Date: Wed, 01 Apr 2026 14:22:38 +0300	[thread overview]
Message-ID: <20260401-vcnl4000-drop-enum-v1-3-ffd201f0c848@gmail.com> (raw)
In-Reply-To: <20260401-vcnl4000-drop-enum-v1-0-ffd201f0c848@gmail.com>

Use a device-managed counterpart of iio_device_register() and remove the
redundant iio_device_unregister() call in driver remove function.

Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
 drivers/iio/light/vcnl4000.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index cbe0a9e056ec..4ba91dac1f55 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -2043,7 +2043,7 @@ static int vcnl4000_probe(struct i2c_client *client)
 	if (ret < 0)
 		goto fail_poweroff;
 
-	ret = iio_device_register(indio_dev);
+	ret = devm_iio_device_register(dev, indio_dev);
 	if (ret < 0)
 		goto fail_poweroff;
 
@@ -2099,7 +2099,6 @@ static void vcnl4000_remove(struct i2c_client *client)
 
 	pm_runtime_dont_use_autosuspend(&client->dev);
 	pm_runtime_disable(&client->dev);
-	iio_device_unregister(indio_dev);
 	pm_runtime_set_suspended(&client->dev);
 
 	ret = data->chip_spec->set_power_state(data, false);

-- 
2.52.0


  parent reply	other threads:[~2026-04-01 11:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01 11:22 [PATCH 0/3] iio: light: vcnl4000: drop enum ID table and use device-managed register Erikas Bitovtas
2026-04-01 11:22 ` [PATCH 1/3] iio: light: vcnl4000: validate device by prod ID instead of table ID Erikas Bitovtas
2026-04-01 11:22 ` [PATCH 2/3] iio: light: vcnl4000: drop enum id table in favor of chip structs Erikas Bitovtas
2026-04-02  8:21   ` Andy Shevchenko
2026-04-01 11:22 ` Erikas Bitovtas [this message]
2026-04-02  8:20   ` [PATCH 3/3] iio: light: vcnl4000: register an IIO device with a device-managed function Andy Shevchenko

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=20260401-vcnl4000-drop-enum-v1-3-ffd201f0c848@gmail.com \
    --to=xerikasxx@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox