summaryrefslogtreecommitdiff
path: root/sound/core/info.c
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2008-11-12 18:31:37 +0300
committerTakashi Iwai <tiwai@suse.de>2008-11-12 19:07:37 +0300
commitc2eb9c4ea383aee154e7139395872c4da629e715 (patch)
tree1a041003b3260354b6ad5e0ca728ff614f10ca01 /sound/core/info.c
parent9fb6198e8c574c6547fbfac0ae1eaf7894ddfdcc (diff)
downloadlinux-c2eb9c4ea383aee154e7139395872c4da629e715.tar.xz
ALSA: when card identification is changed, change also /proc/asound symlink
Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/info.c')
-rw-r--r--sound/core/info.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sound/core/info.c b/sound/core/info.c
index 527b207462b0..70fa87189f36 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -653,6 +653,23 @@ int snd_info_card_register(struct snd_card *card)
}
/*
+ * called on card->id change
+ */
+void snd_info_card_id_change(struct snd_card *card)
+{
+ mutex_lock(&info_mutex);
+ if (card->proc_root_link) {
+ snd_remove_proc_entry(snd_proc_root, card->proc_root_link);
+ card->proc_root_link = NULL;
+ }
+ if (strcmp(card->id, card->proc_root->name))
+ card->proc_root_link = proc_symlink(card->id,
+ snd_proc_root,
+ card->proc_root->name);
+ mutex_unlock(&info_mutex);
+}
+
+/*
* de-register the card proc file
* called from init.c
*/