mirror of
https://github.com/torvalds/linux.git
synced 2026-10-10 20:38:02 +02:00
ASoC: aw87390: 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/20260806140006.1412298-2-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
d4c669890e
commit
3eea69748a
|
|
@ -248,7 +248,7 @@ static const struct snd_kcontrol_new aw87390_controls[] = {
|
|||
|
||||
static int aw87390_request_firmware_file(struct aw87390 *aw87390)
|
||||
{
|
||||
const struct firmware *cont = NULL;
|
||||
const struct firmware *cont __free(firmware) = NULL;
|
||||
int ret;
|
||||
|
||||
aw87390->aw_pa->fw_status = AW87390_DEV_FW_FAILED;
|
||||
|
|
@ -263,14 +263,11 @@ static int aw87390_request_firmware_file(struct aw87390 *aw87390)
|
|||
|
||||
aw87390->aw_cfg = devm_kzalloc(aw87390->aw_pa->dev,
|
||||
struct_size(aw87390->aw_cfg, data, cont->size), GFP_KERNEL);
|
||||
if (!aw87390->aw_cfg) {
|
||||
release_firmware(cont);
|
||||
if (!aw87390->aw_cfg)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
aw87390->aw_cfg->len = cont->size;
|
||||
memcpy(aw87390->aw_cfg->data, cont->data, cont->size);
|
||||
release_firmware(cont);
|
||||
|
||||
ret = aw88395_dev_load_acf_check(aw87390->aw_pa, aw87390->aw_cfg);
|
||||
if (ret) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user