aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/versal-fpga.c
diff options
context:
space:
mode:
authorDmitry Torokhov <[email protected]>2024-01-17 08:33:07 +0000
committerGreg Kroah-Hartman <[email protected]>2024-03-07 22:02:12 +0000
commit8dde8fa0cc3edce73c050b9882d06c1a575f6402 (patch)
tree7b0d84904da9ba2e4dd4c4c2cc41bfd437c6abca /drivers/fpga/versal-fpga.c
parentplatform-msi: Remove usage of the deprecated ida_simple_xx() API (diff)
downloadkernel-8dde8fa0cc3edce73c050b9882d06c1a575f6402.tar.gz
kernel-8dde8fa0cc3edce73c050b9882d06c1a575f6402.zip
firmware_loader: introduce __free() cleanup hanler
Define cleanup handler using facilities from linux/cleanup.h to simplify error handling in code using firmware loader. This will allow writing code like this: int driver_update_firmware(...) { const struct firmware *fw_entry __free(firmware) = NULL; int error; ... error = request_firmware(&fw_entry, fw_name, dev); if (error) { dev_err(dev, "failed to request firmware %s: %d", fw_name, error); return error; } error = check_firmware_valid(fw_entry); if (error) return error; guard(mutex)(&instance->lock); error = use_firmware(instance, fw); if (error) return error; return 0; } Signed-off-by: Dmitry Torokhov <[email protected]> Acked-by: Luis Chamberalin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/fpga/versal-fpga.c')
0 files changed, 0 insertions, 0 deletions