ASoC: renesas: 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-30-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Takashi Iwai 2026-08-06 16:00:01 +02:00 committed by Mark Brown
parent c566377097
commit 81ab987169
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -715,7 +715,6 @@ static struct snd_soc_dai_driver siu_i2s_dai = {
static int siu_probe(struct platform_device *pdev)
{
const struct firmware *fw_entry;
struct resource *res, *region;
struct siu_info *info;
int ret;
@ -726,6 +725,7 @@ static int siu_probe(struct platform_device *pdev)
siu_i2s_data = info;
info->dev = &pdev->dev;
const struct firmware *fw_entry __free(firmware) = NULL;
ret = request_firmware(&fw_entry, "siu_spb.bin", &pdev->dev);
if (ret)
return ret;
@ -736,8 +736,6 @@ static int siu_probe(struct platform_device *pdev)
*/
memcpy(&info->fw, fw_entry->data, fw_entry->size);
release_firmware(fw_entry);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;