]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: temperature: ltc2983: Fix n_wires default bypassing rotation check
authorLiviu Stan <liviu.stan@analog.com>
Mon, 25 May 2026 16:39:28 +0000 (19:39 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 10:01:50 +0000 (11:01 +0100)
commit434c150752675f44dc52c384a7fa22e5176bc35a
tree55bd94e283fa4d042fad09f7bc624969da9b6184
parent5f9363e523000f05bfbd5440fecfa08ec5d08094
iio: temperature: ltc2983: Fix n_wires default bypassing rotation check

When adi,number-of-wires is absent, n_wires is left at 0. The binding
documents a default of 2 wires, matching the hardware default. However
the current-rotate validation checks n_wires == 2 || n_wires == 3, so
with n_wires = 0 the guard is bypassed and adi,current-rotate is accepted
for a 2-wire RTD.

Initialize n_wires = 2 to match the binding default and ensure the
rotation check fires correctly when the property is absent.

Fixes: f110f3188e56 ("iio: temperature: Add support for LTC2983")
Signed-off-by: Liviu Stan <liviu.stan@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/temperature/ltc2983.c