aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/info.h2
-rw-r--r--sound/core/info.c17
-rw-r--r--sound/core/init.c1
3 files changed, 20 insertions, 0 deletions
diff --git a/include/sound/info.h b/include/sound/info.h
index 8ae72e74f898..46f702a76e4f 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -126,6 +126,7 @@ int snd_info_card_create(struct snd_card * card);
126int snd_info_card_register(struct snd_card * card); 126int snd_info_card_register(struct snd_card * card);
127int snd_info_card_free(struct snd_card * card); 127int snd_info_card_free(struct snd_card * card);
128void snd_info_card_disconnect(struct snd_card * card); 128void snd_info_card_disconnect(struct snd_card * card);
129void snd_info_card_id_change(struct snd_card * card);
129int snd_info_register(struct snd_info_entry * entry); 130int snd_info_register(struct snd_info_entry * entry);
130 131
131/* for card drivers */ 132/* for card drivers */
@@ -160,6 +161,7 @@ static inline int snd_info_card_create(struct snd_card * card) { return 0; }
160static inline int snd_info_card_register(struct snd_card * card) { return 0; } 161static inline int snd_info_card_register(struct snd_card * card) { return 0; }
161static inline int snd_info_card_free(struct snd_card * card) { return 0; } 162static inline int snd_info_card_free(struct snd_card * card) { return 0; }
162static inline void snd_info_card_disconnect(struct snd_card * card) { } 163static inline void snd_info_card_disconnect(struct snd_card * card) { }
164static inline void snd_info_card_id_change(struct snd_card * card) { }
163static inline int snd_info_register(struct snd_info_entry * entry) { return 0; } 165static inline int snd_info_register(struct snd_info_entry * entry) { return 0; }
164 166
165static inline int snd_card_proc_new(struct snd_card *card, const char *name, 167static inline int snd_card_proc_new(struct snd_card *card, const char *name,
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)
653} 653}
654 654
655/* 655/*
656 * called on card->id change
657 */
658void snd_info_card_id_change(struct snd_card *card)
659{
660 mutex_lock(&info_mutex);
661 if (card->proc_root_link) {
662 snd_remove_proc_entry(snd_proc_root, card->proc_root_link);
663 card->proc_root_link = NULL;
664 }
665 if (strcmp(card->id, card->proc_root->name))
666 card->proc_root_link = proc_symlink(card->id,
667 snd_proc_root,
668 card->proc_root->name);
669 mutex_unlock(&info_mutex);
670}
671
672/*
656 * de-register the card proc file 673 * de-register the card proc file
657 * called from init.c 674 * called from init.c
658 */ 675 */
diff --git a/sound/core/init.c b/sound/core/init.c
index 5ff297d1d89a..af1e407ca27f 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -571,6 +571,7 @@ card_id_store_attr(struct device *dev, struct device_attribute *attr,
571 goto __exist; 571 goto __exist;
572 } 572 }
573 strcpy(card->id, buf1); 573 strcpy(card->id, buf1);
574 snd_info_card_id_change(card);
574 mutex_unlock(&snd_card_mutex); 575 mutex_unlock(&snd_card_mutex);
575 576
576 return count; 577 return count;