Skip to contentSkip to conversation

ALSA: core: Fix regression for ELD/codec information files

PATCH In review [email protected] 2 participants 2 messages May 13, 2015 – May 18, 2015 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: core: Fix regression for ELD/codec information files

From: "Lu, Han" <[email protected]>

The commit c560a6797e3b ("ALSA: core: Remove child proc file elements recursively") introduced a regression that ELD/codec information files can not be found on /proc/asound/cardX/. This patch corrects it.

include/sound/info.h +4 -0
index 1626995..ae8d30a 100644
@@ -149,6 +149,10 @@ static inline int snd_card_proc_new(struct snd_card *card, const char *name,
 				    struct snd_info_entry **entryp)
 {
 	*entryp = snd_info_create_card_entry(card, name, card->proc_root);
+	if (snd_info_register(*entryp) < 0) {
+		snd_info_free_entry(*entryp);
+		*entryp = NULL;
+	}
 	return *entryp ? 0 : -ENOMEM;
 }
 
Signature · 1 line
1.9.1
#1 lore raw

At Wed, 13 May 2015 16:36:33 +0800,

Quoted 8 lines · [email protected] wrote:

From: "Lu, Han" <[email protected]>

The commit c560a6797e3b ("ALSA: core: Remove child proc file elements recursively") introduced a regression that ELD/codec information files can not be found on /proc/asound/cardX/. This patch corrects it.

This doesn't fix correctly since snd_card_proc_new() isn't the place to create the real proc file entry. It should be created at the device registration time.

I'm going to post the fix patch series.

thanks,

Takashi

Quoted 19 lines
include/sound/info.h +4 -0
index 1626995..ae8d30a 100644
@@ -149,6 +149,10 @@ static inline int snd_card_proc_new(struct snd_card *card, const char *name,
 				    struct snd_info_entry **entryp)
 {
 	*entryp = snd_info_create_card_entry(card, name, card->proc_root);
+	if (snd_info_register(*entryp) < 0) {
+		snd_info_free_entry(*entryp);
+		*entryp = NULL;
+	}
 	return *entryp ? 0 : -ENOMEM;
 }
 
Signature · 1 line
1.9.1