Commit ad8479ac authored by Olivier Moysan's avatar Olivier Moysan Committed by Jonathan Cameron
Browse files

iio: adc: stm32-dfsdm: handle label as an optional property



The label property is defined as optional in the DFSDM binding.
Parse the label property only when it is defined in the device tree.

Fixes: 3208fa0c ("iio: adc: stm32-dfsdm: adopt generic channels bindings")
Signed-off-by: default avatarOlivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20241114102459.2497178-1-olivier.moysan@foss.st.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent dddfd0c4
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -691,12 +691,15 @@ static int stm32_dfsdm_generic_channel_parse_of(struct stm32_dfsdm *dfsdm,
		return -EINVAL;
	}

	if (fwnode_property_present(node, "label")) {
		/* label is optional */
		ret = fwnode_property_read_string(node, "label", &ch->datasheet_name);
		if (ret < 0) {
			dev_err(&indio_dev->dev,
				" Error parsing 'label' for idx %d\n", ch->channel);
			return ret;
		}
	}

	df_ch =  &dfsdm->ch_list[ch->channel];
	df_ch->id = ch->channel;