Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: ad4030: remove some duplicate code

Remove some duplicate code in the ad4030_get_chan_scale() function by
simplifying the if statement.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250310-iio-adc-ad4030-check-scan-type-err-v1-2-589e4ebd9711@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
dc78e71d de67f28a

+4 -5
+4 -5
drivers/iio/adc/ad4030.c
··· 394 394 if (IS_ERR(scan_type)) 395 395 return PTR_ERR(scan_type); 396 396 397 - if (chan->differential) { 397 + if (chan->differential) 398 398 *val = (st->vref_uv * 2) / MILLI; 399 - *val2 = scan_type->realbits; 400 - return IIO_VAL_FRACTIONAL_LOG2; 401 - } 399 + else 400 + *val = st->vref_uv / MILLI; 402 401 403 - *val = st->vref_uv / MILLI; 404 402 *val2 = scan_type->realbits; 403 + 405 404 return IIO_VAL_FRACTIONAL_LOG2; 406 405 } 407 406