diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-28 10:18:29 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-28 10:18:29 +0200 |
| commit | 0e4965c80ef0f862bff0e2bb6870c8ee118c318e (patch) | |
| tree | 070dd7be7f7b12d31daf5d117b34963299a877bd /drivers/base/devres.c | |
| parent | 785151f50ddacac06c7a3c5f3d31642794507fdf (diff) | |
| parent | e383bb8f958444620d96386811aacf6a49757996 (diff) | |
Merge tag 'gpiod-devm-is-action-added-for-v6.16-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/brgl/linux into driver-core-next
Immutable tag for the driver core tree to pull from
devres: Move devm_*_action*() APIs to devres.h
devres: Add devm_is_action_added() helper
* tag 'gpiod-devm-is-action-added-for-v6.16-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
devres: Add devm_is_action_added() helper
devres: Move devm_*_action*() APIs to devres.h
Diffstat (limited to 'drivers/base/devres.c')
| -rw-r--r-- | drivers/base/devres.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/base/devres.c b/drivers/base/devres.c index eee63bc1f062..ff55e1bcfa30 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -759,6 +759,17 @@ int __devm_add_action(struct device *dev, void (*action)(void *), void *data, co } EXPORT_SYMBOL_GPL(__devm_add_action); +bool devm_is_action_added(struct device *dev, void (*action)(void *), void *data) +{ + struct action_devres devres = { + .data = data, + .action = action, + }; + + return devres_find(dev, devm_action_release, devm_action_match, &devres); +} +EXPORT_SYMBOL_GPL(devm_is_action_added); + /** * devm_remove_action_nowarn() - removes previously added custom action * @dev: Device that owns the action |