ASoC: Intel: avs: Use auto-cleanup for firmware loading

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

Only the code refactoring, no functional changes.

Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-27-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Takashi Iwai 2026-08-06 15:59:58 +02:00 committed by Mark Brown
parent 997261a59b
commit 6a052cf54f
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -2222,7 +2222,7 @@ struct avs_tplg *avs_tplg_new(struct snd_soc_component *comp)
int avs_load_topology(struct snd_soc_component *comp, const char *filename)
{
const struct firmware *fw;
const struct firmware *fw __free(firmware) = NULL;
int ret;
ret = request_firmware(&fw, filename, comp->dev);
@ -2235,7 +2235,6 @@ int avs_load_topology(struct snd_soc_component *comp, const char *filename)
if (ret < 0)
dev_err(comp->dev, "load topology \"%s\" failed: %d\n", filename, ret);
release_firmware(fw);
return ret;
}