summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2026-07-29 10:37:30 +0200
committerTakashi Iwai <tiwai@suse.de>2026-07-31 12:44:36 +0200
commitcbabe7774ad77ef6fcb088077f6331c2c7fdf7e4 (patch)
treec8c6b9fbad050d482d9eb163ccb2c5f8a0a5591f
parentb804214907f4738167277f77aa33abbd69db5301 (diff)
downloadlinux-next-cbabe7774ad77ef6fcb088077f6331c2c7fdf7e4.tar.gz
linux-next-cbabe7774ad77ef6fcb088077f6331c2c7fdf7e4.zip
ALSA: mixart: 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. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260729083735.120219-13-tiwai@suse.de
-rw-r--r--sound/pci/mixart/mixart_hwdep.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c
index 439e3ff05fe1..aa8d5bae30d0 100644
--- a/sound/pci/mixart/mixart_hwdep.c
+++ b/sound/pci/mixart/mixart_hwdep.c
@@ -560,12 +560,11 @@ int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
"miXart8.xlx", "miXart8.elf", "miXart8AES.xlx"
};
char path[32];
-
- const struct firmware *fw_entry;
int i, err;
for (i = 0; i < 3; i++) {
sprintf(path, "mixart/%s", fw_files[i]);
+ const struct firmware *fw_entry __free(firmware) = NULL;
if (request_firmware(&fw_entry, path, &mgr->pci->dev)) {
dev_err(&mgr->pci->dev,
"miXart: can't load firmware %s\n", path);
@@ -573,7 +572,6 @@ int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
}
/* fake hwdep dsp record */
err = mixart_dsp_load(mgr, i, fw_entry);
- release_firmware(fw_entry);
if (err < 0)
return err;
mgr->dsp_loaded |= 1 << i;