ALSA: hda - Allocate name string of each codec

Allocate dynamically the name string of each codec instead of
pointing to a static string.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2008-07-30 15:01:45 +02:00
parent 603c401992
commit f44ac8378d
3 changed files with 29 additions and 15 deletions

View File

@ -511,12 +511,11 @@ static void print_codec_info(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct hda_codec *codec = entry->private_data;
char buf[32];
hda_nid_t nid;
int i, nodes;
snd_hda_get_codec_name(codec, buf, sizeof(buf));
snd_iprintf(buffer, "Codec: %s\n", buf);
snd_iprintf(buffer, "Codec: %s\n",
codec->name ? codec->name : "Not Set");
snd_iprintf(buffer, "Address: %d\n", codec->addr);
snd_iprintf(buffer, "Vendor Id: 0x%x\n", codec->vendor_id);
snd_iprintf(buffer, "Subsystem Id: 0x%x\n", codec->subsystem_id);