public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver-core: move devres_for_each_res() to base.h
@ 2026-01-19 16:27 Danilo Krummrich
  2026-01-20 15:15 ` Greg KH
  2026-01-23 10:48 ` Danilo Krummrich
  0 siblings, 2 replies; 3+ messages in thread
From: Danilo Krummrich @ 2026-01-19 16:27 UTC (permalink / raw)
  To: gregkh, rafael; +Cc: linux-kernel, Danilo Krummrich

devres_for_each_res() is only used by .../firmware_loader/main.c, which
already includes base.h.

The usage of devres_for_each_res() by code outside of driver-core is
questionable, hence move it to base.h.

Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
 drivers/base/base.h           | 4 ++++
 include/linux/device/devres.h | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/base/base.h b/drivers/base/base.h
index 430cbefbc97f..60ee4d466b29 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -213,6 +213,10 @@ static inline void device_set_driver(struct device *dev, const struct device_dri
 	WRITE_ONCE(dev->driver, (struct device_driver *)drv);
 }
 
+void devres_for_each_res(struct device *dev, dr_release_t release,
+			 dr_match_t match, void *match_data,
+			 void (*fn)(struct device *, void *, void *),
+			 void *data);
 int devres_release_all(struct device *dev);
 void device_block_probing(void);
 void device_unblock_probing(void);
diff --git a/include/linux/device/devres.h b/include/linux/device/devres.h
index 9c1e3d643d69..14ab9159bdda 100644
--- a/include/linux/device/devres.h
+++ b/include/linux/device/devres.h
@@ -26,10 +26,6 @@ __devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid, const
 #define devres_alloc_node(release, size, gfp, nid) \
 	__devres_alloc_node(release, size, gfp, nid, #release)
 
-void devres_for_each_res(struct device *dev, dr_release_t release,
-			 dr_match_t match, void *match_data,
-			 void (*fn)(struct device *, void *, void *),
-			 void *data);
 void devres_free(void *res);
 void devres_add(struct device *dev, void *res);
 void *devres_find(struct device *dev, dr_release_t release, dr_match_t match, void *match_data);

base-commit: 744905705113a6ab4c38127f18cc0d71594cfaec
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] driver-core: move devres_for_each_res() to base.h
  2026-01-19 16:27 [PATCH] driver-core: move devres_for_each_res() to base.h Danilo Krummrich
@ 2026-01-20 15:15 ` Greg KH
  2026-01-23 10:48 ` Danilo Krummrich
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2026-01-20 15:15 UTC (permalink / raw)
  To: Danilo Krummrich; +Cc: rafael, linux-kernel

On Mon, Jan 19, 2026 at 05:27:57PM +0100, Danilo Krummrich wrote:
> devres_for_each_res() is only used by .../firmware_loader/main.c, which
> already includes base.h.
> 
> The usage of devres_for_each_res() by code outside of driver-core is
> questionable, hence move it to base.h.
> 
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
>  drivers/base/base.h           | 4 ++++
>  include/linux/device/devres.h | 4 ----
>  2 files changed, 4 insertions(+), 4 deletions(-)

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] driver-core: move devres_for_each_res() to base.h
  2026-01-19 16:27 [PATCH] driver-core: move devres_for_each_res() to base.h Danilo Krummrich
  2026-01-20 15:15 ` Greg KH
@ 2026-01-23 10:48 ` Danilo Krummrich
  1 sibling, 0 replies; 3+ messages in thread
From: Danilo Krummrich @ 2026-01-23 10:48 UTC (permalink / raw)
  To: gregkh, rafael; +Cc: linux-kernel, driver-core

On Mon Jan 19, 2026 at 5:27 PM CET, Danilo Krummrich wrote:
> devres_for_each_res() is only used by .../firmware_loader/main.c, which
> already includes base.h.
>
> The usage of devres_for_each_res() by code outside of driver-core is
> questionable, hence move it to base.h.
>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>

Applied to driver-core-testing, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-23 10:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-19 16:27 [PATCH] driver-core: move devres_for_each_res() to base.h Danilo Krummrich
2026-01-20 15:15 ` Greg KH
2026-01-23 10:48 ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox