mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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 <piyushpatle228@gmail.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
e0c6843248
commit
1619d52fce
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user