All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Ensure we generate a card name
@ 2011-09-20 10:42 Mark Brown
  2011-09-20 10:58 ` Takashi Iwai
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2011-09-20 10:42 UTC (permalink / raw)
  To: Liam Girdwood, Takashi Iwai; +Cc: alsa-devel, patches, Mark Brown

Commit 873bd4c (ASoC: Don't set invalid name string to snd_card->driver
field) broke generation of a driver name for all ASoC cards relying on the
automatic generation of one. Fix this by using the old default with spaces
replaced by underscores.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/soc/soc-core.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 10e5cde..7e30c08 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1432,9 +1432,11 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
 		 "%s", card->name);
 	snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
 		 "%s", card->long_name ? card->long_name : card->name);
-	if (card->driver_name)
-		strlcpy(card->snd_card->driver, card->driver_name,
-			sizeof(card->snd_card->driver));
+	snprintf(card->snd_card->driver, sizeof(card->snd_card->driver),
+		 "%s", card->driver_name ? card->driver_name : card->name);
+	for (i = 0; i < ARRAY_SIZE(card->snd_card->driver); i++)
+		if (card->snd_card->driver[i] == ' ')
+			card->snd_card->driver[i] = '_';
 
 	if (card->late_probe) {
 		ret = card->late_probe(card);
-- 
1.7.6.3

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

end of thread, other threads:[~2011-09-20 13:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 10:42 [PATCH] ASoC: Ensure we generate a card name Mark Brown
2011-09-20 10:58 ` Takashi Iwai
2011-09-20 11:03   ` Mark Brown
2011-09-20 12:12     ` Takashi Iwai
2011-09-20 12:19       ` Mark Brown
2011-09-20 12:51         ` Takashi Iwai
2011-09-20 12:56           ` Mark Brown
2011-09-20 13:02             ` Takashi Iwai
2011-09-20 13:20               ` Mark Brown
2011-09-20 13:30                 ` Takashi Iwai

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.