ASoC: hdac_hda: Use auto-cleanup for firmware loading

Simplify the code to manage the firmware loading with __free(firmware)
auto-cleanup.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-9-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Takashi Iwai 2026-08-06 15:59:40 +02:00 committed by Mark Brown
parent aec8a1e14a
commit a57beee8f8
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -437,7 +437,7 @@ 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;
const struct firmware *fw __free(firmware) = NULL;
dev_info(&hdev->dev, "Applying patch firmware '%s'\n",
loadable_patch[hda_pvt->dev_index]);
@ -451,7 +451,6 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)
dev_err(&hdev->dev, "%s: failed to load hda patch %d\n", __func__, ret);
goto error_no_pm;
}
release_firmware(fw);
}
}
#endif