diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-03-13 13:31:00 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-17 15:09:59 +0100 |
commit | 410e7088e971ad656170fe9768b072b267a95310 (patch) | |
tree | def235a043958ec93c565e78399af7da425c8fe8 /include/linux/device.h | |
parent | 0433686c6092f65b552eadad651f620e51b6aad1 (diff) |
devres: Pass unique name of the resource to devm_add_action_or_reset()
All the same as it's done in the commit e32c80bbd2f9 ("devres:
Pass unique name of the resource to devm_add_action()") applies
to the devm_add_action_or_reset(), which this change makes real.
This helps with debug resource management.
Reported-and-tested-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230313113100.59643-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 0f128520f6e5..12dc08aa5c0f 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -250,17 +250,19 @@ int __devm_add_action(struct device *dev, void (*action)(void *), void *data, co #define devm_add_action(release, action, data) \ __devm_add_action(release, action, data, #action) -static inline int devm_add_action_or_reset(struct device *dev, - void (*action)(void *), void *data) +static inline int __devm_add_action_or_reset(struct device *dev, void (*action)(void *), + void *data, const char *name) { int ret; - ret = devm_add_action(dev, action, data); + ret = __devm_add_action(dev, action, data, name); if (ret) action(data); return ret; } +#define devm_add_action_or_reset(release, action, data) \ + __devm_add_action_or_reset(release, action, data, #action) /** * devm_alloc_percpu - Resource-managed alloc_percpu |