Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120578
b: refs/heads/master
c: c2eb9c4
h: refs/heads/master
v: v3
  • Loading branch information
Jaroslav Kysela authored and Takashi Iwai committed Nov 12, 2008
1 parent a151f27 commit 1769dd9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9fb6198e8c574c6547fbfac0ae1eaf7894ddfdcc
refs/heads/master: c2eb9c4ea383aee154e7139395872c4da629e715
2 changes: 2 additions & 0 deletions trunk/include/sound/info.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ int snd_info_card_create(struct snd_card * card);
int snd_info_card_register(struct snd_card * card);
int snd_info_card_free(struct snd_card * card);
void snd_info_card_disconnect(struct snd_card * card);
void snd_info_card_id_change(struct snd_card * card);
int snd_info_register(struct snd_info_entry * entry);

/* for card drivers */
Expand Down Expand Up @@ -160,6 +161,7 @@ static inline int snd_info_card_create(struct snd_card * card) { return 0; }
static inline int snd_info_card_register(struct snd_card * card) { return 0; }
static inline int snd_info_card_free(struct snd_card * card) { return 0; }
static inline void snd_info_card_disconnect(struct snd_card * card) { }
static inline void snd_info_card_id_change(struct snd_card * card) { }
static inline int snd_info_register(struct snd_info_entry * entry) { return 0; }

static inline int snd_card_proc_new(struct snd_card *card, const char *name,
Expand Down
17 changes: 17 additions & 0 deletions trunk/sound/core/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,23 @@ int snd_info_card_register(struct snd_card *card)
return 0;
}

/*
* 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
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/core/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ card_id_store_attr(struct device *dev, struct device_attribute *attr,
goto __exist;
}
strcpy(card->id, buf1);
snd_info_card_id_change(card);
mutex_unlock(&snd_card_mutex);

return count;
Expand Down

0 comments on commit 1769dd9

Please sign in to comment.