diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-10-01 17:59:43 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-10-15 14:05:28 +0200 |
commit | ded255be2276d365a91af2de7c7f8e2c233d4fa2 (patch) | |
tree | 4b12a3214ae05ccc3b1b31367c9cec53771cc251 /sound/pci/hda/patch_realtek.c | |
parent | 3e19fec33a5493f8a627a96ad3494d6c6dc2a624 (diff) | |
download | lwn-ded255be2276d365a91af2de7c7f8e2c233d4fa2.tar.gz lwn-ded255be2276d365a91af2de7c7f8e2c233d4fa2.zip |
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/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 16b8dcba5c12..e1ffb0202ebc 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -822,17 +822,7 @@ static const struct hda_codec_ops alc_patch_ops = { }; -/* replace the codec chip_name with the given string */ -static int alc_codec_rename(struct hda_codec *codec, const char *name) -{ - kfree(codec->core.chip_name); - codec->core.chip_name = kstrdup(name, GFP_KERNEL); - if (!codec->core.chip_name) { - alc_free(codec); - return -ENOMEM; - } - return 0; -} +#define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name) /* * Rename codecs appropriately from COEF value or subvendor id |