Skip to content

Commit 8a6b798

Browse files
Olivier Moysanjic23
authored andcommitted
iio: adc: stm32-dfsdm: fix st,adc-alt-channel property handling
Initially st,adc-alt-channel property was defined as an enum in the DFSDM binding. The DFSDM binding has been changed to use the new IIO backend framework, along with the adoption of IIO generic channels. In this new binding st,adc-alt-channel is defined as a boolean property, but it is still handled has an enum in DFSDM driver. Fix st,adc-alt-channel property handling in DFSDM driver. Fixes: 3208fa0 ("iio: adc: stm32-dfsdm: adopt generic channels bindings") Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 6327573 commit 8a6b798

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/iio/adc/stm32-dfsdm-adc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,9 +725,8 @@ static int stm32_dfsdm_generic_channel_parse_of(struct stm32_dfsdm *dfsdm,
725725
}
726726
df_ch->src = val;
727727

728-
ret = fwnode_property_read_u32(node, "st,adc-alt-channel", &df_ch->alt_si);
729-
if (ret != -EINVAL)
730-
df_ch->alt_si = 0;
728+
if (fwnode_property_present(node, "st,adc-alt-channel"))
729+
df_ch->alt_si = 1;
731730

732731
if (adc->dev_data->type == DFSDM_IIO) {
733732
backend = devm_iio_backend_fwnode_get(&indio_dev->dev, NULL, node);

0 commit comments

Comments
 (0)