diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-10-17 10:07:43 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-10-17 17:39:31 -0400 |
commit | 84db9150b64ccad9c40e42a9967f1cf9592ebc8f (patch) | |
tree | c5e45b7eb27c8ab431c6fec4733c23c112b7ab07 /sound/pci | |
parent | 801f49d3b84c18f66afb54532b54894b1b2afe2d (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.c | 17 |
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) | |||
5678 | if ((coef & 0x00f0) == 0x0030) { | 5678 | if ((coef & 0x00f0) == 0x0030) { |
5679 | kfree(codec->chip_name); | 5679 | kfree(codec->chip_name); |
5680 | if (codec->vendor_id == 0x10ec0887) | 5680 | if (codec->vendor_id == 0x10ec0887) |
5681 | codec->chip_name = kstrdup("ALC887-VD", GFP_KERNEL); | 5681 | err = alc_codec_rename(codec, "ALC887-VD"); |
5682 | else | 5682 | else |
5683 | codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL); | 5683 | err = alc_codec_rename(codec, "ALC888-VD"); |
5684 | if (!codec->chip_name) { | 5684 | if (err < 0) { |
5685 | alc_free(codec); | 5685 | alc_free(codec); |
5686 | return -ENOMEM; | 5686 | return -ENOMEM; |
5687 | } | 5687 | } |
@@ -5691,9 +5691,8 @@ static int patch_alc888(struct hda_codec *codec) | |||
5691 | /* For ALC888S-VC */ | 5691 | /* For ALC888S-VC */ |
5692 | if (codec->vendor_id == 0x10ec0888) { | 5692 | if (codec->vendor_id == 0x10ec0888) { |
5693 | if ((coef & 0xf0f0) == 0x3020) { | 5693 | if ((coef & 0xf0f0) == 0x3020) { |
5694 | kfree(codec->chip_name); | 5694 | err = alc_codec_rename(codec, "ALC886"); |
5695 | codec->chip_name = kstrdup("ALC886", GFP_KERNEL); | 5695 | if (err < 0) { |
5696 | if (!codec->chip_name) { | ||
5697 | alc_free(codec); | 5696 | alc_free(codec); |
5698 | return -ENOMEM; | 5697 | return -ENOMEM; |
5699 | } | 5698 | } |
@@ -5705,8 +5704,10 @@ static int patch_alc888(struct hda_codec *codec) | |||
5705 | static int patch_alc899(struct hda_codec *codec) | 5704 | static int patch_alc899(struct hda_codec *codec) |
5706 | { | 5705 | { |
5707 | if ((alc_read_coef_idx(codec, 0) & 0x2000) != 0x2000) { | 5706 | if ((alc_read_coef_idx(codec, 0) & 0x2000) != 0x2000) { |
5708 | kfree(codec->chip_name); | 5707 | if (alc_codec_rename(codec, "ALC898") < 0) { |
5709 | codec->chip_name = kstrdup("ALC898", GFP_KERNEL); | 5708 | alc_free(codec); |
5709 | return -ENOMEM; | ||
5710 | } | ||
5710 | } | 5711 | } |
5711 | return patch_alc882(codec); | 5712 | return patch_alc882(codec); |
5712 | } | 5713 | } |