mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
iio: temperature: ltc2983: Fix n_wires default bypassing rotation check
commit434c150752upstream. 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:f110f3188e("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b50344ab20
commit
e16258913b
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user