* [PATCH] of: platform: rename parameter 'bus' to 'node' in of_platform_bus_create()
@ 2025-07-17 13:14 Bo Sun
2025-07-31 9:04 ` Ahmad Fatoum
2025-08-05 8:26 ` Sascha Hauer
0 siblings, 2 replies; 3+ messages in thread
From: Bo Sun @ 2025-07-17 13:14 UTC (permalink / raw)
To: barebox
The parameter represents a device tree node, not specifically a bus.
Use more accurate naming following device tree conventions.
Signed-off-by: Bo Sun <bo@mboxify.com>
---
drivers/of/platform.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 3600b5f9c1..092ec39b05 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -399,14 +399,14 @@ static inline struct device *of_amba_device_create(struct device_node *np)
/**
* of_platform_bus_create() - Create a device for a node and its children.
- * @bus: device node of the bus to instantiate
+ * @node: device node of the bus to instantiate
* @matches: match table for bus nodes
* @parent: parent for new device, or NULL for top level.
*
* Creates a platform_device for the provided device_node, and optionally
* recursively create devices for all the child nodes.
*/
-static int of_platform_bus_create(struct device_node *bus,
+static int of_platform_bus_create(struct device_node *node,
const struct of_device_id *matches,
struct device *parent)
{
@@ -415,22 +415,22 @@ static int of_platform_bus_create(struct device_node *bus,
int rc = 0;
/* Make sure it has a compatible property */
- if (!of_get_property(bus, "compatible", NULL)) {
+ if (!of_get_property(node, "compatible", NULL)) {
pr_debug("%s() - skipping %pOF, no compatible prop\n",
- __func__, bus);
+ __func__, node);
return 0;
}
- if (of_device_is_compatible(bus, "arm,primecell")) {
- if (of_amba_device_create(bus))
+ if (of_device_is_compatible(node, "arm,primecell")) {
+ if (of_amba_device_create(node))
return 0;
}
- dev = of_platform_device_create(bus, parent);
- if (!dev || !of_match_node(matches, bus))
+ dev = of_platform_device_create(node, parent);
+ if (!dev || !of_match_node(matches, node))
return 0;
- for_each_child_of_node(bus, child) {
+ for_each_child_of_node(node, child) {
pr_debug(" create child: %pOF\n", child);
rc = of_platform_bus_create(child, matches, dev);
if (rc)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] of: platform: rename parameter 'bus' to 'node' in of_platform_bus_create()
2025-07-17 13:14 [PATCH] of: platform: rename parameter 'bus' to 'node' in of_platform_bus_create() Bo Sun
@ 2025-07-31 9:04 ` Ahmad Fatoum
2025-08-05 8:26 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2025-07-31 9:04 UTC (permalink / raw)
To: Bo Sun, barebox
On 7/17/25 15:14, Bo Sun wrote:
> The parameter represents a device tree node, not specifically a bus.
> Use more accurate naming following device tree conventions.
>
> Signed-off-by: Bo Sun <bo@mboxify.com>
Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> drivers/of/platform.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 3600b5f9c1..092ec39b05 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -399,14 +399,14 @@ static inline struct device *of_amba_device_create(struct device_node *np)
>
> /**
> * of_platform_bus_create() - Create a device for a node and its children.
> - * @bus: device node of the bus to instantiate
> + * @node: device node of the bus to instantiate
> * @matches: match table for bus nodes
> * @parent: parent for new device, or NULL for top level.
> *
> * Creates a platform_device for the provided device_node, and optionally
> * recursively create devices for all the child nodes.
> */
> -static int of_platform_bus_create(struct device_node *bus,
> +static int of_platform_bus_create(struct device_node *node,
> const struct of_device_id *matches,
> struct device *parent)
> {
> @@ -415,22 +415,22 @@ static int of_platform_bus_create(struct device_node *bus,
> int rc = 0;
>
> /* Make sure it has a compatible property */
> - if (!of_get_property(bus, "compatible", NULL)) {
> + if (!of_get_property(node, "compatible", NULL)) {
> pr_debug("%s() - skipping %pOF, no compatible prop\n",
> - __func__, bus);
> + __func__, node);
> return 0;
> }
>
> - if (of_device_is_compatible(bus, "arm,primecell")) {
> - if (of_amba_device_create(bus))
> + if (of_device_is_compatible(node, "arm,primecell")) {
> + if (of_amba_device_create(node))
> return 0;
> }
>
> - dev = of_platform_device_create(bus, parent);
> - if (!dev || !of_match_node(matches, bus))
> + dev = of_platform_device_create(node, parent);
> + if (!dev || !of_match_node(matches, node))
> return 0;
>
> - for_each_child_of_node(bus, child) {
> + for_each_child_of_node(node, child) {
> pr_debug(" create child: %pOF\n", child);
> rc = of_platform_bus_create(child, matches, dev);
> if (rc)
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] of: platform: rename parameter 'bus' to 'node' in of_platform_bus_create()
2025-07-17 13:14 [PATCH] of: platform: rename parameter 'bus' to 'node' in of_platform_bus_create() Bo Sun
2025-07-31 9:04 ` Ahmad Fatoum
@ 2025-08-05 8:26 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-08-05 8:26 UTC (permalink / raw)
To: barebox, Bo Sun
On Thu, 17 Jul 2025 21:14:31 +0800, Bo Sun wrote:
> The parameter represents a device tree node, not specifically a bus.
> Use more accurate naming following device tree conventions.
>
>
Applied, thanks!
[1/1] of: platform: rename parameter 'bus' to 'node' in of_platform_bus_create()
https://git.pengutronix.de/cgit/barebox/commit/?id=1f2fd7c50a85 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-05 9:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-17 13:14 [PATCH] of: platform: rename parameter 'bus' to 'node' in of_platform_bus_create() Bo Sun
2025-07-31 9:04 ` Ahmad Fatoum
2025-08-05 8:26 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox