Commit 61cbfb53 authored by Dumitru Ceclan's avatar Dumitru Ceclan Committed by Jonathan Cameron
Browse files

iio: adc: ad7124: fix DT configuration parsing



The cfg pointer is set before reading the channel number that the
configuration should point to. This causes configurations to be shifted
by one channel.
For example setting bipolar to the first channel defined in the DT will
cause bipolar mode to be active on the second defined channel.

Fix by moving the cfg pointer setting after reading the channel number.

Fixes: 7b8d045e ("iio: adc: ad7124: allow more than 8 channels")
Signed-off-by: default avatarDumitru Ceclan <dumitru.ceclan@analog.com>
Reviewed-by: default avatarNuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240806085133.114547-1-dumitru.ceclan@analog.com


Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent e81bb580
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment