All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: simple_card_utils: fix fallback when "label" property isn't present
@ 2017-08-29 15:51 Lucas Stach
  2017-08-30  0:02 ` Kuninori Morimoto
  2017-08-30 17:57 ` Applied "ASoC: simple_card_utils: fix fallback when "label" property isn't present" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Lucas Stach @ 2017-08-29 15:51 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Kuninori Morimoto
  Cc: alsa-devel, patchwork-lst, Takashi Iwai, kernel

snd_soc_of_parse_card_name() doesn't return an error if the requested
property isn't present, but silently fails to fill the card name. This can
not be changed, as it is a backwards compatibility measure itself.

We can not rely on the return value of this function alone, but must check
if the card name has been filled sucessfully when deciding to skip the
fallback path, which is in place for existing users.

Fixes: dedfaa1eedc7 (ASoC: simple-card-utils: enable "label" on
                     asoc_simple_card_parse_card_name)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
This may be applied instead of the revert I just sent. After examining the
function more closely, the fix seems easy enough to go into 4.13 final.
---
 sound/soc/generic/simple-card-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 7d7ab4aee42e..d72f7d58102f 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -132,7 +132,7 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
 
 	/* Parse the card name from DT */
 	ret = snd_soc_of_parse_card_name(card, "label");
-	if (ret < 0) {
+	if (ret < 0 || !card->name) {
 		char prop[128];
 
 		snprintf(prop, sizeof(prop), "%sname", prefix);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: simple_card_utils: fix fallback when "label" property isn't present
  2017-08-29 15:51 [PATCH] ASoC: simple_card_utils: fix fallback when "label" property isn't present Lucas Stach
@ 2017-08-30  0:02 ` Kuninori Morimoto
  2017-08-30 17:57 ` Applied "ASoC: simple_card_utils: fix fallback when "label" property isn't present" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2017-08-30  0:02 UTC (permalink / raw)
  To: Lucas Stach
  Cc: alsa-devel, Liam Girdwood, Takashi Iwai, patchwork-lst,
	Mark Brown, kernel


Hi Lucas

> snd_soc_of_parse_card_name() doesn't return an error if the requested
> property isn't present, but silently fails to fill the card name. This can
> not be changed, as it is a backwards compatibility measure itself.
> 
> We can not rely on the return value of this function alone, but must check
> if the card name has been filled sucessfully when deciding to skip the
> fallback path, which is in place for existing users.
> 
> Fixes: dedfaa1eedc7 (ASoC: simple-card-utils: enable "label" on
>                      asoc_simple_card_parse_card_name)
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
> This may be applied instead of the revert I just sent. After examining the
> function more closely, the fix seems easy enough to go into 4.13 final.

Yes, indeed.
Thanks

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>


Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "ASoC: simple_card_utils: fix fallback when "label" property isn't present" to the asoc tree
  2017-08-29 15:51 [PATCH] ASoC: simple_card_utils: fix fallback when "label" property isn't present Lucas Stach
  2017-08-30  0:02 ` Kuninori Morimoto
@ 2017-08-30 17:57 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2017-08-30 17:57 UTC (permalink / raw)
  To: Lucas Stach
  Cc: alsa-devel, Kuninori Morimoto, Takashi Iwai, Liam Girdwood,
	Mark Brown, kernel, patchwork-lst

The patch

   ASoC: simple_card_utils: fix fallback when "label" property isn't present

has been applied to the asoc tree at

   git://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 1b4a56cd7f5c2f835ffae2a8204fb95597269b10 Mon Sep 17 00:00:00 2001
From: Lucas Stach <l.stach@pengutronix.de>
Date: Tue, 29 Aug 2017 17:51:22 +0200
Subject: [PATCH] ASoC: simple_card_utils: fix fallback when "label" property
 isn't present

snd_soc_of_parse_card_name() doesn't return an error if the requested
property isn't present, but silently fails to fill the card name. This can
not be changed, as it is a backwards compatibility measure itself.

We can not rely on the return value of this function alone, but must check
if the card name has been filled sucessfully when deciding to skip the
fallback path, which is in place for existing users.

Fixes: dedfaa1eedc7 (ASoC: simple-card-utils: enable "label" on
                     asoc_simple_card_parse_card_name)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/generic/simple-card-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 26d64fa40c9c..0442099157e6 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -132,7 +132,7 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
 
 	/* Parse the card name from DT */
 	ret = snd_soc_of_parse_card_name(card, "label");
-	if (ret < 0) {
+	if (ret < 0 || !card->name) {
 		char prop[128];
 
 		snprintf(prop, sizeof(prop), "%sname", prefix);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-30 17:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 15:51 [PATCH] ASoC: simple_card_utils: fix fallback when "label" property isn't present Lucas Stach
2017-08-30  0:02 ` Kuninori Morimoto
2017-08-30 17:57 ` Applied "ASoC: simple_card_utils: fix fallback when "label" property isn't present" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.