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

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
...@@ -113,7 +113,7 @@ static int dmic_dev_probe(struct platform_device *pdev) ...@@ -113,7 +113,7 @@ static int dmic_dev_probe(struct platform_device *pdev)
if (pdev->dev.of_node) { if (pdev->dev.of_node) {
err = of_property_read_u32(pdev->dev.of_node, "num-channels", &chans); err = of_property_read_u32(pdev->dev.of_node, "num-channels", &chans);
if (err && (err != -ENOENT)) if (err && (err != -EINVAL))
return err; return err;
if (!err) { if (!err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment