* [PATCH 4.4.y 1/3] ASoC: simple-card: Fix misleading error message
@ 2018-02-06 6:33 Nhan Nguyen
2018-02-06 20:31 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Nhan Nguyen @ 2018-02-06 6:33 UTC (permalink / raw)
To: greg
Cc: yasushi.onishi.xc, binh.nguyen.uw, Julian Scheel, stable,
Mark Brown, thongsyho, Nhan Nguyen
From: Julian Scheel <julian@jusst.de>
commit 7ac45d1635a4cd2e99a4b11903d4a2815ca1b27b upstream.
In case cpu could not be found the error message would always refer to
/codec/ not being found in DT. Fix this by catching the cpu node not found
case explicitly.
Cc: stable@vger.kernel.org
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: thongsyho <thong.ho.px@rvc.renesas.com>
Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com>
---
sound/soc/generic/simple-card.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index ff6fcd9..0b1b6fc 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -343,13 +343,19 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
snprintf(prop, sizeof(prop), "%scpu", prefix);
cpu = of_get_child_by_name(node, prop);
+ if (!cpu) {
+ ret = -EINVAL;
+ dev_err(dev, "%s: Can't find %s DT node\n", __func__, prop);
+ goto dai_link_of_err;
+ }
+
snprintf(prop, sizeof(prop), "%splat", prefix);
plat = of_get_child_by_name(node, prop);
snprintf(prop, sizeof(prop), "%scodec", prefix);
codec = of_get_child_by_name(node, prop);
- if (!cpu || !codec) {
+ if (!codec) {
ret = -EINVAL;
dev_err(dev, "%s: Can't find %s DT node\n", __func__, prop);
goto dai_link_of_err;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 4.4.y 1/3] ASoC: simple-card: Fix misleading error message
2018-02-06 6:33 [PATCH 4.4.y 1/3] ASoC: simple-card: Fix misleading error message Nhan Nguyen
@ 2018-02-06 20:31 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2018-02-06 20:31 UTC (permalink / raw)
To: Nhan Nguyen
Cc: yasushi.onishi.xc, binh.nguyen.uw, Julian Scheel, stable,
Mark Brown, thongsyho
On Tue, Feb 06, 2018 at 01:33:39PM +0700, Nhan Nguyen wrote:
> From: Julian Scheel <julian@jusst.de>
>
> commit 7ac45d1635a4cd2e99a4b11903d4a2815ca1b27b upstream.
>
> In case cpu could not be found the error message would always refer to
> /codec/ not being found in DT. Fix this by catching the cpu node not found
> case explicitly.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Julian Scheel <julian@jusst.de>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Signed-off-by: thongsyho <thong.ho.px@rvc.renesas.com>
> Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com>
> ---
> sound/soc/generic/simple-card.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
Are you going to send the series for 4.9 for these patches?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-06 20:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-06 6:33 [PATCH 4.4.y 1/3] ASoC: simple-card: Fix misleading error message Nhan Nguyen
2018-02-06 20:31 ` Greg KH
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).