ALSA: info: Register proc entries recursively, too
[deliverable/linux.git] / sound / core / init.c
index 769a783757ff293085dc69372a6b7c38c50b16ba..f8abd2d8144e121ea4884b027d1933ec8d655828 100644 (file)
@@ -107,26 +107,20 @@ static void snd_card_id_read(struct snd_info_entry *entry,
        snd_iprintf(buffer, "%s\n", entry->card->id);
 }
 
-static inline int init_info_for_card(struct snd_card *card)
+static int init_info_for_card(struct snd_card *card)
 {
        int err;
        struct snd_info_entry *entry;
 
-       if ((err = snd_info_card_register(card)) < 0) {
-               dev_dbg(card->dev, "unable to create card info\n");
-               return err;
-       }
-       if ((entry = snd_info_create_card_entry(card, "id", card->proc_root)) == NULL) {
+       entry = snd_info_create_card_entry(card, "id", card->proc_root);
+       if (!entry) {
                dev_dbg(card->dev, "unable to create card entry\n");
                return err;
        }
        entry->c.text.read = snd_card_id_read;
-       if (snd_info_register(entry) < 0) {
-               snd_info_free_entry(entry);
-               entry = NULL;
-       }
        card->proc_id = entry;
-       return 0;
+
+       return snd_info_card_register(card);
 }
 #else /* !CONFIG_PROC_FS */
 #define init_info_for_card(card)
@@ -756,7 +750,7 @@ int snd_card_register(struct snd_card *card)
        if (snd_cards[card->number]) {
                /* already registered */
                mutex_unlock(&snd_card_mutex);
-               return 0;
+               return snd_info_card_register(card); /* register pending info */
        }
        if (*card->id) {
                /* make a unique id name from the given string */
This page took 0.023666 seconds and 5 git commands to generate.