mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-12-04 22:31:15 -06:00
ASoC: aw88166: 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-4-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -1570,7 +1570,7 @@ static int aw88166_dev_init(struct aw88166 *aw88166, struct aw_container *aw_cfg
|
||||
|
||||
static int aw88166_request_firmware_file(struct aw88166 *aw88166)
|
||||
{
|
||||
const struct firmware *cont = NULL;
|
||||
const struct firmware *cont __free(firmware) = NULL;
|
||||
const char *fw_name;
|
||||
int ret;
|
||||
|
||||
@@ -1590,13 +1590,11 @@ static int aw88166_request_firmware_file(struct aw88166 *aw88166)
|
||||
|
||||
aw88166->aw_cfg = devm_kzalloc(aw88166->aw_pa->dev,
|
||||
struct_size(aw88166->aw_cfg, data, cont->size), GFP_KERNEL);
|
||||
if (!aw88166->aw_cfg) {
|
||||
release_firmware(cont);
|
||||
if (!aw88166->aw_cfg)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
aw88166->aw_cfg->len = (int)cont->size;
|
||||
memcpy(aw88166->aw_cfg->data, cont->data, cont->size);
|
||||
release_firmware(cont);
|
||||
|
||||
ret = aw88395_dev_load_acf_check(aw88166->aw_pa, aw88166->aw_cfg);
|
||||
if (ret) {
|
||||
|
||||
Reference in New Issue
Block a user