From: Piyush Patle <piyushpatle228@gmail.com>
To: "Nuno Sá" <nuno.sa@analog.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Andy Shevchenko" <andy@kernel.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] iio: dac: ad3552r: use field_get() for power-down bit read
Date: Sat, 11 Apr 2026 10:46:47 +0530 [thread overview]
Message-ID: <20260411051650.11949-1-piyushpatle228@gmail.com> (raw)
Use field_get() for the per-channel DAC power-down bit instead of an
open-coded mask-and-shift sequence.
No functional change.
Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
---
drivers/iio/dac/ad3552r.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
index 93c33bc3e1be..f206bba3a701 100644
--- a/drivers/iio/dac/ad3552r.c
+++ b/drivers/iio/dac/ad3552r.c
@@ -167,8 +167,7 @@ static int ad3552r_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&dac->lock);
if (err < 0)
return err;
- *val = !((tmp_val & AD3552R_MASK_CH_DAC_POWERDOWN(ch)) >>
- __ffs(AD3552R_MASK_CH_DAC_POWERDOWN(ch)));
+ *val = !field_get(AD3552R_MASK_CH_DAC_POWERDOWN(ch), tmp_val);
return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE:
*val = dac->ch_data[ch].scale_int;
--
2.43.0
next reply other threads:[~2026-04-11 5:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-11 5:16 Piyush Patle [this message]
2026-04-11 12:49 ` Nuno Sá
2026-04-19 16:57 ` Piyush Patle
2026-04-20 13:08 ` 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=20260411051650.11949-1-piyushpatle228@gmail.com \
--to=piyushpatle228@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.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
all inboxes | Powered by JetHome®