Bartosz Golaszewski
d364d2ad07
devres: provide devm_kmemdup_const()
...
Provide a function similar to devm_strdup_const() but for copying blocks
of memory that are likely to be placed in .rodata.
Reviewed-by: Andy Shevchenko <andy@kernel.org >
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Tested-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Signed-off-by: Linus Walleij <linus.walleij@linaro.org >
2025-09-08 14:21:23 +02:00
Andy Shevchenko
e383bb8f95
devres: Add devm_is_action_added() helper
...
In some code we would like to know if the action in device managed resources
was added by devm_add_action() family of calls. Introduce a helper for that.
Reviewed-by: Raag Jadav <raag.jadav@intel.com >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Zijun Hu <quic_zijuhu@quicinc.com >
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Link: https://lore.kernel.org/r/20250220162238.2738038-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2025-04-28 09:30:41 +02:00
Andy Shevchenko
f5e5631df5
devres: Move devm_*_action*() APIs to devres.h
...
We have a newly created header linux/device/devres.h that gathers
device managed APIs, so users won't need to include entire device.h
for only these ones. Move devm_*_action*() APIs to devres.h as well.
Reviewed-by: Raag Jadav <raag.jadav@intel.com >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Zijun Hu <quic_zijuhu@quicinc.com >
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Link: https://lore.kernel.org/r/20250220162238.2738038-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2025-04-28 09:30:40 +02:00
Raag Jadav
a103b833ac
devres: Introduce devm_kmemdup_array()
...
Introduce '_array' variant of devm_kmemdup() which is more robust and
consistent with alloc family of helpers.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Raag Jadav <raag.jadav@intel.com >
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
2025-02-24 12:08:52 +02:00
Andy Shevchenko
a21cad9312
driver core: Split devres APIs to device/devres.h
...
device.h is a huge header which is hard to follow and easy to miss
something. Improve that by splitting devres APIs to device/devres.h.
In particular this helps to speedup the build of the code that includes
device.h solely for a devres APIs.
While at it, cast the error pointers to __iomem using IOMEM_ERR_PTR()
and fix sparse warnings.
Signed-off-by: Raag Jadav <raag.jadav@intel.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
2025-02-24 12:08:51 +02:00