All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alisa-Dariana Roman <alisadariana@gmail.com>
Cc: alexandru.tachici@analog.com, alisa.roman@analog.com,
	alisadariana@gmail.com, conor+dt@kernel.org,
	devicetree@vger.kernel.org, dlechner@baylibre.com,
	jic23@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	krzysztof.kozlowski@linaro.org, lars@metafoo.de,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	michael.hennerich@analog.com, robh+dt@kernel.org
Subject: [PATCH v3 2/5] iio: adc: ad7192: Pass state directly
Date: Thu,  8 Feb 2024 19:24:56 +0200	[thread overview]
Message-ID: <20240208172459.280189-3-alisa.roman@analog.com> (raw)
In-Reply-To: <20240208172459.280189-1-alisa.roman@analog.com>

Pass only the ad7192_state structure. There is no need to pass the
iio_dev structure.

Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com>
---
 drivers/iio/adc/ad7192.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c
index 48e0357564af..5e8043865233 100644
--- a/drivers/iio/adc/ad7192.c
+++ b/drivers/iio/adc/ad7192.c
@@ -384,9 +384,8 @@ static int ad7192_device_clock_select(struct ad7192_state *st)
 	return clock_sel;
 }
 
-static int ad7192_setup(struct iio_dev *indio_dev)
+static int ad7192_setup(struct ad7192_state *st)
 {
-	struct ad7192_state *st = iio_priv(indio_dev);
 	struct device *dev = &st->sd.spi->dev;
 	bool rej60_en, refin2_en;
 	bool buf_en, bipolar, burnout_curr_en;
@@ -458,7 +457,7 @@ static int ad7192_setup(struct iio_dev *indio_dev)
 	/* Populate available ADC input ranges */
 	for (i = 0; i < ARRAY_SIZE(st->scale_avail); i++) {
 		scale_uv = ((u64)st->int_vref_mv * 100000000)
-			>> (indio_dev->channels[0].scan_type.realbits -
+			>> (st->chip_info->channels[0].scan_type.realbits -
 			!FIELD_GET(AD7192_CONF_UNIPOLAR, st->conf));
 		scale_uv >>= i;
 
@@ -1150,7 +1149,7 @@ static int ad7192_probe(struct spi_device *spi)
 		}
 	}
 
-	ret = ad7192_setup(indio_dev);
+	ret = ad7192_setup(st);
 	if (ret)
 		return ret;
 
-- 
2.34.1


  parent reply	other threads:[~2024-02-08 17:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08 17:24 [PATCH v3 0/5] iio: adc: ad7192: Add support for AD7194 Alisa-Dariana Roman
2024-02-08 17:24 ` [PATCH v3 1/5] iio: adc: ad7192: Use device api Alisa-Dariana Roman
2024-02-08 18:20   ` Andy Shevchenko
2024-02-08 17:24 ` Alisa-Dariana Roman [this message]
2024-02-08 17:24 ` [PATCH v3 3/5] iio: adc: ad7192: Use standard attribute Alisa-Dariana Roman
2024-02-10 15:52   ` Jonathan Cameron
2024-02-08 17:24 ` [PATCH v3 4/5] dt-bindings: iio: adc: ad7192: Add AD7194 support Alisa-Dariana Roman
2024-02-08 18:03   ` Conor Dooley
2024-02-15 12:13     ` Alisa-Dariana Roman
2024-02-15 12:52       ` Conor Dooley
2024-02-08 21:02   ` David Lechner
2024-02-08 17:24 ` [PATCH v3 5/5] " Alisa-Dariana Roman
2024-02-08 22:27   ` David Lechner
2024-02-15 13:22     ` Alisa-Dariana Roman
2024-02-15 17:13       ` David Lechner
2024-02-16 14:21         ` Jonathan Cameron
2024-02-16 16:57           ` David Lechner
2024-02-17 16:25             ` Jonathan Cameron
2024-02-19 16:10               ` David Lechner
2024-02-19 16:33         ` David Lechner
2024-02-19 19:30           ` 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=20240208172459.280189-3-alisa.roman@analog.com \
    --to=alisadariana@gmail.com \
    --cc=alexandru.tachici@analog.com \
    --cc=alisa.roman@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=robh+dt@kernel.org \
    /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.