summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/hdac_hda.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/hdac_hda.c')
-rw-r--r--sound/soc/codecs/hdac_hda.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/soc/codecs/hdac_hda.c b/sound/soc/codecs/hdac_hda.c
index 8f5d97949d3d..355f30779a34 100644
--- a/sound/soc/codecs/hdac_hda.c
+++ b/sound/soc/codecs/hdac_hda.c
@@ -37,10 +37,10 @@
SNDRV_PCM_RATE_192000)
#ifdef CONFIG_SND_HDA_PATCH_LOADER
-static char *loadable_patch[SNDRV_CARDS];
+static char *loadable_patch[HDA_MAX_CODECS];
module_param_array_named(patch, loadable_patch, charp, NULL, 0444);
-MODULE_PARM_DESC(patch, "Patch file for Intel HD audio interface.");
+MODULE_PARM_DESC(patch, "Patch file array for Intel HD audio interface. The array index is the codec address.");
#endif
static int hdac_hda_dai_open(struct snd_pcm_substream *substream,
@@ -434,20 +434,21 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)
#ifdef CONFIG_SND_HDA_PATCH_LOADER
if (loadable_patch[hda_pvt->dev_index] && *loadable_patch[hda_pvt->dev_index]) {
+ const struct firmware *fw;
+
dev_info(&hdev->dev, "Applying patch firmware '%s'\n",
loadable_patch[hda_pvt->dev_index]);
- ret = request_firmware(&hda_pvt->fw, loadable_patch[hda_pvt->dev_index],
+ ret = request_firmware(&fw, loadable_patch[hda_pvt->dev_index],
&hdev->dev);
if (ret < 0)
goto error_no_pm;
- if (hda_pvt->fw) {
- ret = snd_hda_load_patch(hcodec->bus, hda_pvt->fw->size, hda_pvt->fw->data);
+ if (fw) {
+ ret = snd_hda_load_patch(hcodec->bus, fw->size, fw->data);
if (ret < 0) {
dev_err(&hdev->dev, "failed to load hda patch %d\n", ret);
goto error_no_pm;
}
- release_firmware(hda_pvt->fw);
- hda_pvt->fw = NULL;
+ release_firmware(fw);
}
}
#endif