mirror of
https://github.com/torvalds/linux.git
synced 2026-10-13 13:51:03 +02:00
ASoC: peb2466: 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. Reviewed-by: Herve Codina <herve.codina@bootlin.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260806140006.1412298-13-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
c0124e91a9
commit
38a3855d0c
|
|
@ -1538,17 +1538,14 @@ static int peb2466_fw_parse(struct snd_soc_component *component,
|
|||
|
||||
static int peb2466_load_coeffs(struct snd_soc_component *component, const char *fw_name)
|
||||
{
|
||||
const struct firmware *fw;
|
||||
const struct firmware *fw __free(firmware) = NULL;
|
||||
int ret;
|
||||
|
||||
ret = request_firmware(&fw, fw_name, component->dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = peb2466_fw_parse(component, fw->data, fw->size);
|
||||
release_firmware(fw);
|
||||
|
||||
return ret;
|
||||
return peb2466_fw_parse(component, fw->data, fw->size);
|
||||
}
|
||||
|
||||
static int peb2466_component_probe(struct snd_soc_component *component)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user