* [PATCH] ASoC: codecs: dmic: Fix check of return value from read of 'num-channels'
@ 2018-01-19 23:36 Matthias Kaehlcke
2018-01-22 12:21 ` Mark Brown
2018-01-22 12:26 ` Applied "ASoC: dmic: Fix check of return value from read of 'num-channels'" to the asoc tree Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Matthias Kaehlcke @ 2018-01-19 23:36 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: alsa-devel, linux-kernel, Matthias Kaehlcke
Commit 7fb59e940f62 ("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: 7fb59e940f62 ("ASoC: codecs: dmic: Make number of channels configurable")
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
sound/soc/codecs/dmic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/dmic.c b/sound/soc/codecs/dmic.c
index c88f974ebe3e..cf83c423394d 100644
--- a/sound/soc/codecs/dmic.c
+++ b/sound/soc/codecs/dmic.c
@@ -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) {
--
2.16.0.rc1.238.g530d649a79-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: codecs: dmic: Fix check of return value from read of 'num-channels'
2018-01-19 23:36 [PATCH] ASoC: codecs: dmic: Fix check of return value from read of 'num-channels' Matthias Kaehlcke
@ 2018-01-22 12:21 ` Mark Brown
2018-01-22 12:26 ` Applied "ASoC: dmic: Fix check of return value from read of 'num-channels'" to the asoc tree Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2018-01-22 12:21 UTC (permalink / raw)
To: Matthias Kaehlcke
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 556 bytes --]
On Fri, Jan 19, 2018 at 03:36:50PM -0800, Matthias Kaehlcke wrote:
> Commit 7fb59e940f62 ("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
Please submit patches using subject lines reflecting the style for the
subsystem. This makes it easier for people to identify relevant
patches. Look at what existing commits in the area you're changing are
doing and make sure your subject lines visually resemble what they're
doing.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Applied "ASoC: dmic: Fix check of return value from read of 'num-channels'" to the asoc tree
2018-01-19 23:36 [PATCH] ASoC: codecs: dmic: Fix check of return value from read of 'num-channels' Matthias Kaehlcke
2018-01-22 12:21 ` Mark Brown
@ 2018-01-22 12:26 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2018-01-22 12:26 UTC (permalink / raw)
To: Matthias Kaehlcke
Cc: Mark Brown, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, alsa-devel, linux-kernel, alsa-devel
The patch
ASoC: dmic: Fix check of return value from read of 'num-channels'
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 35b84bf0614a7da98bfbbac70ed3d01c3b5b6c58 Mon Sep 17 00:00:00 2001
From: Matthias Kaehlcke <mka@chromium.org>
Date: Fri, 19 Jan 2018 15:36:50 -0800
Subject: [PATCH] ASoC: dmic: Fix check of return value from read of
'num-channels'
Commit 7fb59e940f62 ("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: 7fb59e940f62 ("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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/dmic.c b/sound/soc/codecs/dmic.c
index c88f974ebe3e..cf83c423394d 100644
--- a/sound/soc/codecs/dmic.c
+++ b/sound/soc/codecs/dmic.c
@@ -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) {
--
2.15.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-22 12:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19 23:36 [PATCH] ASoC: codecs: dmic: Fix check of return value from read of 'num-channels' Matthias Kaehlcke
2018-01-22 12:21 ` Mark Brown
2018-01-22 12:26 ` Applied "ASoC: dmic: Fix check of return value from read of 'num-channels'" to the asoc tree Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).