summaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-10-17 16:07:43 +0200
committerTakashi Iwai <tiwai@suse.de>2011-10-17 23:39:31 +0200
commit84db9150b64ccad9c40e42a9967f1cf9592ebc8f (patch)
treec5e45b7eb27c8ab431c6fec4733c23c112b7ab07 /sound/pci
parent801f49d3b84c18f66afb54532b54894b1b2afe2d (diff)
ALSA: hda/realtek - Use alc_codec_rename()
Replaced with alc_codec_rename() in all possible places. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e78f36a528ca..cc861c1d69ec 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5678,10 +5678,10 @@ static int patch_alc888(struct hda_codec *codec)
if ((coef & 0x00f0) == 0x0030) {
kfree(codec->chip_name);
if (codec->vendor_id == 0x10ec0887)
- codec->chip_name = kstrdup("ALC887-VD", GFP_KERNEL);
+ err = alc_codec_rename(codec, "ALC887-VD");
else
- codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL);
- if (!codec->chip_name) {
+ err = alc_codec_rename(codec, "ALC888-VD");
+ if (err < 0) {
alc_free(codec);
return -ENOMEM;
}
@@ -5691,9 +5691,8 @@ static int patch_alc888(struct hda_codec *codec)
/* For ALC888S-VC */
if (codec->vendor_id == 0x10ec0888) {
if ((coef & 0xf0f0) == 0x3020) {
- kfree(codec->chip_name);
- codec->chip_name = kstrdup("ALC886", GFP_KERNEL);
- if (!codec->chip_name) {
+ err = alc_codec_rename(codec, "ALC886");
+ if (err < 0) {
alc_free(codec);
return -ENOMEM;
}
@@ -5705,8 +5704,10 @@ static int patch_alc888(struct hda_codec *codec)
static int patch_alc899(struct hda_codec *codec)
{
if ((alc_read_coef_idx(codec, 0) & 0x2000) != 0x2000) {
- kfree(codec->chip_name);
- codec->chip_name = kstrdup("ALC898", GFP_KERNEL);
+ if (alc_codec_rename(codec, "ALC898") < 0) {
+ alc_free(codec);
+ return -ENOMEM;
+ }
}
return patch_alc882(codec);
}