ASoC: tlv320aic31xx: 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.

Cc: Shenghao Ding <shenghao-ding@ti.com>
Cc: Kevin Lu <kevin-lu@ti.com>
Cc: Baojun Xu <baojun.xu@ti.com>
Cc: Sen Wang <sen@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260806140006.1412298-22-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Takashi Iwai 2026-08-06 15:59:53 +02:00 committed by Mark Brown
parent 834c7c8511
commit e420e87ddc
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -1720,18 +1720,14 @@ static int tlv320dac3100_fw_load(struct aic31xx_priv *aic31xx,
static int tlv320dac3100_load_coeffs(struct aic31xx_priv *aic31xx,
const char *fw_name)
{
const struct firmware *fw;
const struct firmware *fw __free(firmware) = NULL;
int ret;
ret = request_firmware(&fw, fw_name, aic31xx->dev);
if (ret)
return ret;
ret = tlv320dac3100_fw_load(aic31xx, fw->data, fw->size);
release_firmware(fw);
return ret;
return tlv320dac3100_fw_load(aic31xx, fw->data, fw->size);
}
static int aic31xx_i2c_probe(struct i2c_client *i2c)