summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_realtek.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/patch_realtek.c
parent3e19fec33a5493f8a627a96ad3494d6c6dc2a624 (diff)
downloadlwn-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.c12
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