aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/hda_codec.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 393a3043a46e..98976c8ed107 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1264,13 +1264,6 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus,
1264 snd_array_init(&codec->cvt_setups, sizeof(struct hda_cvt_setup), 8); 1264 snd_array_init(&codec->cvt_setups, sizeof(struct hda_cvt_setup), 8);
1265 snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64); 1265 snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64);
1266 snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16); 1266 snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16);
1267 if (codec->bus->modelname) {
1268 codec->modelname = kstrdup(codec->bus->modelname, GFP_KERNEL);
1269 if (!codec->modelname) {
1270 snd_hda_codec_free(codec);
1271 return -ENODEV;
1272 }
1273 }
1274 1267
1275#ifdef CONFIG_SND_HDA_POWER_SAVE 1268#ifdef CONFIG_SND_HDA_POWER_SAVE
1276 INIT_DELAYED_WORK(&codec->power_work, hda_power_work); 1269 INIT_DELAYED_WORK(&codec->power_work, hda_power_work);
@@ -1281,6 +1274,14 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus,
1281 hda_keep_power_on(codec); 1274 hda_keep_power_on(codec);
1282#endif 1275#endif
1283 1276
1277 if (codec->bus->modelname) {
1278 codec->modelname = kstrdup(codec->bus->modelname, GFP_KERNEL);
1279 if (!codec->modelname) {
1280 snd_hda_codec_free(codec);
1281 return -ENODEV;
1282 }
1283 }
1284
1284 list_add_tail(&codec->list, &bus->codec_list); 1285 list_add_tail(&codec->list, &bus->codec_list);
1285 bus->caddr_tbl[codec_addr] = codec; 1286 bus->caddr_tbl[codec_addr] = codec;
1286 1287