]> git.alsa-project.org Git - alsa-tools.git/commitdiff
hdajackretask: Make sure codecs do not show up twice under 3.15 kernel
authorDavid Henningsson <david.henningsson@canonical.com>
Tue, 27 May 2014 07:12:36 +0000 (09:12 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 27 May 2014 07:28:54 +0000 (09:28 +0200)
On a 3.15 based kernel, both "hdaudioC*D*" and "hwC*D*" shows up under
/sys/class/sound, and pointing to the same object. Make sure we only
match on the hwC*D* name to avoid duplicate entries.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
hdajackretask/sysfs-pin-configs.c

index 40449894185e4929cc934da2ddd9eea753bf57cd..5bae0f9cd3a4b4fb055f66e46c69a2e6fa79a679 100644 (file)
@@ -20,8 +20,10 @@ int get_codec_name_list(codec_name_t* names, int entries)
         const gchar* dirname = g_dir_read_name(sysdir);
         if (!dirname)
             break;
+        /* Split e g "hwC0D1" into "hw", "0" and "1" */
         cd = g_strsplit_set(dirname, "CD", 9);
         ok = g_strv_length(cd) == 3;
+        ok &= strcmp(cd[0], "hw") == 0;
         if (ok) {
             gchar* filetest = g_strdup_printf("/sys/class/sound/%s/init_pin_configs", dirname);
             ok = g_file_test(filetest, G_FILE_TEST_IS_REGULAR);