summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_sysfs.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-10-01 17:59:43 +0200
committerTakashi Iwai <tiwai@suse.de>2015-10-15 14:05:28 +0200
commitded255be2276d365a91af2de7c7f8e2c233d4fa2 (patch)
tree4b12a3214ae05ccc3b1b31367c9cec53771cc251 /sound/pci/hda/hda_sysfs.c
parent3e19fec33a5493f8a627a96ad3494d6c6dc2a624 (diff)
ALSA: hda - consolidate chip rename functions
A few multiple codec drivers do renaming the chip_name string but all these are open-coded and some of them have even no error check. Let's make common helpers to do it properly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_sysfs.c')
-rw-r--r--sound/pci/hda/hda_sysfs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_sysfs.c b/sound/pci/hda/hda_sysfs.c
index a6e3d9b511ab..64e0d1d81ca5 100644
--- a/sound/pci/hda/hda_sysfs.c
+++ b/sound/pci/hda/hda_sysfs.c
@@ -595,8 +595,7 @@ static void parse_model_mode(char *buf, struct hda_bus *bus,
static void parse_chip_name_mode(char *buf, struct hda_bus *bus,
struct hda_codec **codecp)
{
- kfree((*codecp)->core.chip_name);
- (*codecp)->core.chip_name = kstrdup(buf, GFP_KERNEL);
+ snd_hda_codec_set_name(*codecp, buf);
}
#define DEFINE_PARSE_ID_MODE(name) \