diff options
| author | Liviu Stan <liviu.stan@analog.com> | 2026-05-25 19:39:28 +0300 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-05-31 13:01:50 +0300 |
| commit | 434c150752675f44dc52c384a7fa22e5176bc35a (patch) | |
| tree | 55bd94e283fa4d042fad09f7bc624969da9b6184 | |
| parent | 5f9363e523000f05bfbd5440fecfa08ec5d08094 (diff) | |
| download | linux-434c150752675f44dc52c384a7fa22e5176bc35a.tar.xz | |
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>
| -rw-r--r-- | drivers/iio/temperature/ltc2983.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 38e6f8dfd3b8..1f835e326b93 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -741,7 +741,7 @@ ltc2983_rtd_new(const struct fwnode_handle *child, struct ltc2983_data *st, struct ltc2983_rtd *rtd; int ret = 0; struct device *dev = &st->spi->dev; - u32 excitation_current = 0, n_wires = 0; + u32 excitation_current = 0, n_wires = 2; rtd = devm_kzalloc(dev, sizeof(*rtd), GFP_KERNEL); if (!rtd) |
