From: thongsyho thong.ho.px@rvc.renesas.com
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 --- 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;
On Mon, Feb 05, 2018 at 10:11:35AM +0700, Nhan Nguyen wrote:
From: thongsyho thong.ho.px@rvc.renesas.com
That author is not the author of:
commit 7ac45d1635a4cd2e99a4b11903d4a2815ca1b27b upstream.
^ that commit :(
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
As you are forwarding these patches on to me, I need your signed-off-by as well on these patches.
Also, I have no idea what order these should all be applied in. Please fix the above issues, and resend this series, and the series for the 4.9 kernel tree, as a numbered patch series so I have a hint as to what order to apply them.
thanks,
greg k-h
On 2/6/2018 12:53 AM, Greg KH wrote:
On Mon, Feb 05, 2018 at 10:11:35AM +0700, Nhan Nguyen wrote:
From: thongsyho thong.ho.px@rvc.renesas.com
That author is not the author of:
commit 7ac45d1635a4cd2e99a4b11903d4a2815ca1b27b upstream.
^ that commit :(
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
As you are forwarding these patches on to me, I need your signed-off-by as well on these patches.
Also, I have no idea what order these should all be applied in. Please fix the above issues, and resend this series, and the series for the 4.9 kernel tree, as a numbered patch series so I have a hint as to what order to apply them.
thanks,
greg k-h
Hello Greg,
I see. Thank for your comments! I'll resend new patch files.
Regards, Nhan Ng
linux-stable-mirror@lists.linaro.org