Skip to contentSkip to conversation

iio: adc: ad7173: Fix uninitialized symbol is_current_chan

PATCH New Jonathan Cameron 1 participant 1 message Jul 2, 2024

Subsystems (2)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH 1/1 iio: adc: ad7173: Fix uninitialized symbol is_current_chan

From: Jonathan Cameron <[email protected]>

Move the definition down and make it a boolean that is initialized to false.

Fixes 13d12e3ad12d ("iio: adc: ad7173: Add support for AD411x devices")

---
I applied this directly to the togreg branch of iio.git. Normally I'd have squashed this with the patch, but it is a long way back in the history under a couple of merges.

 drivers/iio/adc/ad7173.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/adc/ad7173.c +3 -1
index 7da70b7422bb..9544bf7142ad 100644
@@ -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];
Signature · 1 line
2.45.2