Re: [PATCH v3 4/7] iio: adc: ad7625: use standard unit names
From: Jonathan Cameron
Date: Fri Nov 06 2026 - 20:55:52 EST
On Fri, 6 Nov 2026 18:05:16 +0200
Nicolae-Daniel Deaconescu <Nicolae-daniel.Deaconescu@xxxxxxxxxx> wrote:
> Use standard unit spelling and macros in existing code:
>
> - Rename vref_mv to vref_mV and ref_mv to ref_mV, spelling the voltage unit
> as mV.
What about poor Heinrich Hertz? If we are doing this let's acknowledge
his contribution as well and use _Hz as the postfix for those.
Also Volta isn't doing well in some of this.
I'm generally in favour of this stuff but it is churn heavy to
tidy up in existing code. So my preference is keep these improvements
for places where you are modifying the naming anyway or making lots
of new use of an existing variable.
> - Use HZ_PER_MHZ instead of MEGA for frequencies.
> - Use MICRO / MILLI instead of 1000 to convert the reference voltage from
> uV to mV.
>
> No behaviour change.
>
> Signed-off-by: Nicolae-Daniel Deaconescu <Nicolae-daniel.Deaconescu@xxxxxxxxxx>
> @@ -517,7 +517,7 @@ static int devm_ad7625_regulator_setup(struct device *dev,
> struct ad7625_state *st)
> {
>
> - if (ref_mv == 5000 && !st->can_ref_5v)
> + if (ref_mV == 5000 && !st->can_ref_5v)
Why is it 5v rather than 5V?
> return dev_err_probe(dev, -EINVAL,
> "REF is 5V in unsupported mode\n");
>
> - st->vref_mv = ref_mv ?: AD7625_INTERNAL_REF_MV;
> + st->vref_mV = ref_mV ?: AD7625_INTERNAL_REF_MV;