]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: dmic: Fix check of return value from read of 'num-channels'
authorMatthias Kaehlcke <mka@chromium.org>
Fri, 19 Jan 2018 23:36:50 +0000 (15:36 -0800)
committerMark Brown <broonie@kernel.org>
Mon, 22 Jan 2018 12:20:46 +0000 (12:20 +0000)
commiteb9541c4a9ddddca0df162ecbd0f865a4179f57c
tree82ae84e6ebf99726291a5eff2b36fa0d6a2adab7
parente20e337794f2dbab5cb67cfef63600350bc0cddd
ASoC: dmic: Fix check of return value from read of 'num-channels'

Commit e20e337794f2 ("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: e20e337794f2 ("ASoC: codecs: dmic: Make number of channels configurable")
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/dmic.c