Linux IIO development
 help / color / mirror / Atom feed
From: Rupesh Majhi <zoone.rupert@gmail.com>
To: "Andy Shevchenko" <andy@kernel.org>,
	"Bill Wendling" <morbo@google.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Eddie James" <eajames@linux.ibm.com>,
	"Joel Stanley" <joel@jms.id.au>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Justin Stitt" <justinstitt@google.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <nick.desaulniers+lkml@gmail.com>,
	"Nuno Sá" <nuno.sa@analog.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev, Rupesh Majhi <zoone.rupert@gmail.com>
Subject: [PATCH v6 2/6] iio: pressure: dps310: use a local device pointer in probe
Date: Mon, 24 Aug 2026 23:11:59 +0300	[thread overview]
Message-ID: <20260824201203.396651-3-zoone.rupert@gmail.com> (raw)
In-Reply-To: <20260824201203.396651-1-zoone.rupert@gmail.com>

probe() spells out &client->dev for every devm call. Take it into a local
once instead, keeps lines short as more calls are added later in this
series.

No functional change.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com>
---
 drivers/iio/pressure/dps310.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
index 68382960382f..25d1c79876e6 100644
--- a/drivers/iio/pressure/dps310.c
+++ b/drivers/iio/pressure/dps310.c
@@ -846,11 +846,12 @@ static const struct iio_info dps310_info = {
 static int dps310_probe(struct i2c_client *client)
 {
 	const struct i2c_device_id *id = i2c_client_get_device_id(client);
+	struct device *dev = &client->dev;
 	struct dps310_data *data;
 	struct iio_dev *iio;
 	int rc;
 
-	iio = devm_iio_device_alloc(&client->dev,  sizeof(*data));
+	iio = devm_iio_device_alloc(dev, sizeof(*data));
 	if (!iio)
 		return -ENOMEM;
 
@@ -869,7 +870,7 @@ static int dps310_probe(struct i2c_client *client)
 		return PTR_ERR(data->regmap);
 
 	/* Register to run the device reset when the device is removed */
-	rc = devm_add_action_or_reset(&client->dev, dps310_reset, data);
+	rc = devm_add_action_or_reset(dev, dps310_reset, data);
 	if (rc)
 		return rc;
 
@@ -877,7 +878,7 @@ static int dps310_probe(struct i2c_client *client)
 	if (rc)
 		return rc;
 
-	rc = devm_iio_device_register(&client->dev, iio);
+	rc = devm_iio_device_register(dev, iio);
 	if (rc)
 		return rc;
 
-- 
2.43.0


  parent reply	other threads:[~2026-08-24 20:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 20:11 [PATCH v6 0/6] iio: pressure: dps310: FIFO and triggered buffer support Rupesh Majhi
2026-08-24 20:11 ` [PATCH v6 1/6] iio: pressure: dps310: fix CFG_REG bit definitions Rupesh Majhi
2026-08-24 20:11 ` Rupesh Majhi [this message]
2026-08-24 20:12 ` [PATCH v6 3/6] iio: pressure: dps310: rework the raw read paths Rupesh Majhi
2026-08-25  8:59   ` Andy Shevchenko
2026-08-24 20:12 ` [PATCH v6 4/6] iio: pressure: dps310: add triggered buffer support Rupesh Majhi
2026-08-25  9:06   ` Andy Shevchenko
2026-08-24 20:12 ` [PATCH v6 5/6] iio: pressure: dps310: add hardware FIFO support Rupesh Majhi
2026-08-25  9:39   ` Andy Shevchenko
2026-08-24 20:12 ` [PATCH v6 6/6] iio: pressure: dps310: check the lock markings with context analysis Rupesh Majhi

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=20260824201203.396651-3-zoone.rupert@gmail.com \
    --to=zoone.rupert@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=eajames@linux.ibm.com \
    --cc=jic23@kernel.org \
    --cc=joel@jms.id.au \
    --cc=justinstitt@google.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --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