diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-07-02 20:43:46 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-07-02 20:43:46 +0200 |
commit | 529d2e1900642eba6df28307e26e19793e227546 (patch) | |
tree | 0e7c819d01b20bb2afa45ef17627336f4c0442a8 /drivers/iio | |
parent | iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC (diff) | |
download | linux-529d2e1900642eba6df28307e26e19793e227546.tar.xz linux-529d2e1900642eba6df28307e26e19793e227546.zip |
iio: adc: ad7173: Fix uninitialized symbol is_current_chan
Move the definition down and make it a boolean that is initialized
to false.
Fixes: 13d12e3ad12d ("iio: adc: ad7173: Add support for AD411x devices")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202406232046.DKfBJq6o-lkp@intel.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/adc/ad7173.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c index 7da70b7422bb..9544bf7142ad 100644 --- a/drivers/iio/adc/ad7173.c +++ b/drivers/iio/adc/ad7173.c @@ -1188,7 +1188,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev) struct device *dev = indio_dev->dev.parent; struct iio_chan_spec *chan_arr, *chan; unsigned int ain[AD7173_NO_AINS_PER_CHANNEL], chan_index = 0; - int ref_sel, ret, is_current_chan, num_channels; + int ref_sel, ret, num_channels; num_channels = device_get_child_node_count(dev); @@ -1234,6 +1234,8 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev) } device_for_each_child_node_scoped(dev, child) { + bool is_current_chan = false; + chan = &chan_arr[chan_index]; *chan = ad7173_channel_template; chan_st_priv = &chans_st_arr[chan_index]; |