From: Piyush Patle Date: Sat, 11 Apr 2026 05:16:47 +0000 (+0530) Subject: iio: dac: ad3552r: use field_get() for power-down bit read X-Git-Tag: v7.2-rc1~67^2~5^2~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1619d52fce78b47021a2f1aa5b95f7986ab66c0f;p=thirdparty%2Fkernel%2Flinux.git iio: dac: ad3552r: use field_get() for power-down bit read 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 Reviewed-by: Nuno Sá Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c index 93c33bc3e1be4..f206bba3a701a 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;