Using ARRAY_SIZE macro when setting up ASoC audio map?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Does an example patch to spitz below make any sense? Yep, noticed when forgot to add array terminator to own code :-)

diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c
index d56709e..1cffcd3 100644
--- a/sound/soc/pxa/spitz.c
+++ b/sound/soc/pxa/spitz.c
@@ -268,8 +268,6 @@ static const char *audio_map[][3] = {
 
 	/* line is connected to input 1 - no bias */
 	{"LINPUT1", NULL, "Line Jack"},
-
-	{NULL, NULL, NULL},
 };
 
 static const char *jack_function[] = {"Headphone", "Mic", "Line", "Headset",
@@ -317,7 +315,7 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec)
 	}
 
 	/* Set up spitz specific audio path audio_map */
-	for (i = 0; audio_map[i][0] != NULL; i++) {
+	for (i = 0; i < ARRAY_SIZE(audio_map); i++) {
 		snd_soc_dapm_connect_input(codec, audio_map[i][0],
 			audio_map[i][1], audio_map[i][2]);
 	}
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux