Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 35b84bf0 authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by Mark Brown
Browse files

ASoC: dmic: Fix check of return value from read of 'num-channels'



Commit 7fb59e94 ("ASoC: codecs: dmic: Make number of channels
 configurable") introduces an optional property to the device tree
to specify the number of DMIC channels. dmic_codec_probe() uses
of_property_read_u32() to read the DT value, and expects a return
value of -ENOENT when the property does not exist. This expectation
is incorrect, the actual value returned in this case is -EINVAL (see
of_find_property_value_of_size(), which is called under the hood).
Check for -EINVAL instead.

Fixes: 7fb59e94 ("ASoC: codecs: dmic: Make number of channels configurable")
Signed-off-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7fb59e94
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ static int dmic_dev_probe(struct platform_device *pdev)

	if (pdev->dev.of_node) {
		err = of_property_read_u32(pdev->dev.of_node, "num-channels", &chans);
		if (err && (err != -ENOENT))
		if (err && (err != -EINVAL))
			return err;

		if (!err) {