linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: "Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
	"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
Subject: [PATCH v3 1/5] iio: amplifiers: ada4250: used dev local variable
Date: Wed, 11 Jun 2025 16:33:01 -0500	[thread overview]
Message-ID: <20250611-iio-amplifiers-ada4250-simplify-data-buffer-in-init-v3-1-bf85ddea79f2@baylibre.com> (raw)
In-Reply-To: <20250611-iio-amplifiers-ada4250-simplify-data-buffer-in-init-v3-0-bf85ddea79f2@baylibre.com>

Replace local spi variable with dev in ada4250_init() since spi is not
used directly.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/amplifiers/ada4250.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/iio/amplifiers/ada4250.c b/drivers/iio/amplifiers/ada4250.c
index f81438460aa51ce30f8f605c60ee5be5c8c251d3..397c1e1545cfccad9b0ff58b133796d415130064 100644
--- a/drivers/iio/amplifiers/ada4250.c
+++ b/drivers/iio/amplifiers/ada4250.c
@@ -299,24 +299,24 @@ static void ada4250_reg_disable(void *data)
 
 static int ada4250_init(struct ada4250_state *st)
 {
+	struct device *dev = &st->spi->dev;
 	int ret;
 	u16 chip_id;
-	struct spi_device *spi = st->spi;
 
-	st->refbuf_en = device_property_read_bool(&spi->dev, "adi,refbuf-enable");
+	st->refbuf_en = device_property_read_bool(dev, "adi,refbuf-enable");
 
-	st->reg = devm_regulator_get(&spi->dev, "avdd");
+	st->reg = devm_regulator_get(dev, "avdd");
 	if (IS_ERR(st->reg))
-		return dev_err_probe(&spi->dev, PTR_ERR(st->reg),
+		return dev_err_probe(dev, PTR_ERR(st->reg),
 				     "failed to get the AVDD voltage\n");
 
 	ret = regulator_enable(st->reg);
 	if (ret) {
-		dev_err(&spi->dev, "Failed to enable specified AVDD supply\n");
+		dev_err(dev, "Failed to enable specified AVDD supply\n");
 		return ret;
 	}
 
-	ret = devm_add_action_or_reset(&spi->dev, ada4250_reg_disable, st->reg);
+	ret = devm_add_action_or_reset(dev, ada4250_reg_disable, st->reg);
 	if (ret)
 		return ret;
 
@@ -333,7 +333,7 @@ static int ada4250_init(struct ada4250_state *st)
 	chip_id = le16_to_cpu(st->reg_val_16);
 
 	if (chip_id != ADA4250_CHIP_ID) {
-		dev_err(&spi->dev, "Invalid chip ID.\n");
+		dev_err(dev, "Invalid chip ID.\n");
 		return -EINVAL;
 	}
 

-- 
2.43.0


  reply	other threads:[~2025-06-11 21:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 21:33 [PATCH v3 0/5] iio: amplifiers: ada4250: various cleanups David Lechner
2025-06-11 21:33 ` David Lechner [this message]
2025-06-11 21:33 ` [PATCH v3 2/5] iio: amplifiers: ada4250: don't fail on bad chip ID David Lechner
2025-06-11 21:33 ` [PATCH v3 3/5] iio: amplifiers: ada4250: use devm_regulator_get_enable_read_voltage() David Lechner
2025-06-12 13:03   ` Andy Shevchenko
2025-06-12 15:31     ` David Lechner
2025-06-11 21:33 ` [PATCH v3 4/5] iio: amplifiers: ada4250: move offset_uv in struct David Lechner
2025-06-12 13:04   ` Andy Shevchenko
2025-06-12 15:31     ` David Lechner
2025-06-12 18:34       ` Andy Shevchenko
2025-06-12 18:45         ` David Lechner
2025-06-12 18:58           ` Andy Shevchenko
2025-06-11 21:33 ` [PATCH v3 5/5] iio: amplifiers: ada4250: use dev_err_probe() David Lechner
2025-06-12 13:05   ` Andy Shevchenko
2025-06-12 15:33     ` David Lechner
2025-06-12 13:07 ` [PATCH v3 0/5] iio: amplifiers: ada4250: various cleanups Andy Shevchenko
2025-06-14 12:07   ` 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=20250611-iio-amplifiers-ada4250-simplify-data-buffer-in-init-v3-1-bf85ddea79f2@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --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;
as well as URLs for NNTP newsgroup(s).