Skip to contentSkip to conversation

iio: adc: stm32-adc: add debug info if dt uses legacy channel config

PATCH In review Sean Nyekjaer 2 participants 2 messages Apr 21, 2023 – Apr 23, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iio: adc: stm32-adc: add debug info if dt uses legacy channel config

Since nearly all stm32 dt's are using the legacy adc channel config, we should warn users about using it.

---
Changes since v1:
- Changed dev_warn -> dev_dbg

 drivers/iio/adc/stm32-adc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/adc/stm32-adc.c +2 -0
index 1aadb2ad2cab..e179b6611e4d 100644
@@ -1993,6 +1993,8 @@ static int stm32_adc_get_legacy_chan_count(struct iio_dev *indio_dev, struct stm
 	const struct stm32_adc_info *adc_info = adc->cfg->adc_info;
 	int num_channels = 0, ret;
 
+	dev_dbg(&indio_dev->dev, "using legacy channel config\n");
+
 	ret = device_property_count_u32(dev, "st,adc-channels");
 	if (ret > adc_info->max_channels) {
 		dev_err(&indio_dev->dev, "Bad st,adc-channels?\n");
Signature · 1 line
2.40.0
maintainer
#1 lore raw
Quoted 4 lines · On Fri, 21 Apr 2023 10:38:58 +0200 Sean Nyekjaer <[email protected]> wrote:

Since nearly all stm32 dt's are using the legacy adc channel config, we should warn users about using it.

This is far enough (I think) from the code touched in the fixes (I'm waiting for review from Olivier for those) that I can merge
it through a different branch. So taken this one for the togreg branch of
iio.git - initially pushed out as testing for 0-day to take a poke at it.

Thanks,

Jonathan

Quoted 20 lines

---
Changes since v1:
- Changed dev_warn -> dev_dbg

 drivers/iio/adc/stm32-adc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/adc/stm32-adc.c +2 -0
index 1aadb2ad2cab..e179b6611e4d 100644
@@ -1993,6 +1993,8 @@ static int stm32_adc_get_legacy_chan_count(struct iio_dev *indio_dev, struct stm
 	const struct stm32_adc_info *adc_info = adc->cfg->adc_info;
 	int num_channels = 0, ret;
 
+	dev_dbg(&indio_dev->dev, "using legacy channel config\n");
+
 	ret = device_property_count_u32(dev, "st,adc-channels");
 	if (ret > adc_info->max_channels) {
 		dev_err(&indio_dev->dev, "Bad st,adc-channels?\n");