mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 22:13:55 -04:00
ALSA: sh: 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-15-tiwai@suse.de
This commit is contained in:
@@ -518,8 +518,9 @@ static const struct snd_kcontrol_new snd_aica_pcmvolume_control = {
|
||||
static int load_aica_firmware(void)
|
||||
{
|
||||
int err;
|
||||
const struct firmware *fw_entry;
|
||||
spu_reset();
|
||||
|
||||
const struct firmware *fw_entry __free(firmware) = NULL;
|
||||
err = request_firmware(&fw_entry, "aica_firmware.bin", &pd->dev);
|
||||
if (unlikely(err))
|
||||
return err;
|
||||
@@ -527,7 +528,6 @@ static int load_aica_firmware(void)
|
||||
spu_disable();
|
||||
spu_memload(0, fw_entry->data, fw_entry->size);
|
||||
spu_enable();
|
||||
release_firmware(fw_entry);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user