[PATCH v2 0/3] iio: adc: Provide mult_fract() and make use of it

From: Andy Shevchenko

Date: Thu Nov 19 2026 - 14:24:24 EST


In a couple of IIO ADC driver the suggested new helper mult_fract()
may be used. So, provide it and update the straightforward users.

The helper has potential treewide, hence it's provided directly in math.h.

In v2:
- updated commit message in patch 1 (Sashiko, c/o Joshua)
- used local variable to avoid double evaluation (Sashiko, c/o Joshua)
- collected tags (Marcelo)

v1: <20261117091638.1463621-1-andriy.shevchenko@xxxxxxxxxxxxxxx>

Andy Shevchenko (3):
math.h: Add mult_fract() that takes struct __Txx_fract as argument
iio: adc: ad4030: Switch to use mult_fract() helper
iio: adc: ltc2378: Switch to use mult_fract() helper

drivers/iio/adc/ad4030.c | 13 ++++++-------
drivers/iio/adc/ltc2378.c | 4 +++-
include/linux/math.h | 7 +++++++
3 files changed, 16 insertions(+), 8 deletions(-)

--
2.50.1