* [PATCH] of: kobj: make of_node_is_(initialized|attached) parameters const
@ 2021-10-14 17:30 Nathan Lynch
2021-10-20 16:29 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Lynch @ 2021-10-14 17:30 UTC (permalink / raw)
To: devicetree; +Cc: robh+dt, frowand.list, linux-kernel
of_node_is_initialized() and of_node_is_attached() don't modify the node
objects passed to them, so those parameters should be const.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
drivers/of/kobj.c | 4 ++--
drivers/of/of_private.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/of/kobj.c b/drivers/of/kobj.c
index 6675b5e56960..7d3853a5a09a 100644
--- a/drivers/of/kobj.c
+++ b/drivers/of/kobj.c
@@ -5,13 +5,13 @@
#include "of_private.h"
/* true when node is initialized */
-static int of_node_is_initialized(struct device_node *node)
+static int of_node_is_initialized(const struct device_node *node)
{
return node && node->kobj.state_initialized;
}
/* true when node is attached (i.e. present on sysfs) */
-int of_node_is_attached(struct device_node *node)
+int of_node_is_attached(const struct device_node *node)
{
return node && node->kobj.state_in_sysfs;
}
diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h
index 75e67b8bb826..9324483397f6 100644
--- a/drivers/of/of_private.h
+++ b/drivers/of/of_private.h
@@ -60,7 +60,7 @@ static inline int of_property_notify(int action, struct device_node *np,
#endif /* CONFIG_OF_DYNAMIC */
#if defined(CONFIG_OF_KOBJ)
-int of_node_is_attached(struct device_node *node);
+int of_node_is_attached(const struct device_node *node);
int __of_add_property_sysfs(struct device_node *np, struct property *pp);
void __of_remove_property_sysfs(struct device_node *np, struct property *prop);
void __of_update_property_sysfs(struct device_node *np, struct property *newprop,
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] of: kobj: make of_node_is_(initialized|attached) parameters const
2021-10-14 17:30 [PATCH] of: kobj: make of_node_is_(initialized|attached) parameters const Nathan Lynch
@ 2021-10-20 16:29 ` Rob Herring
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2021-10-20 16:29 UTC (permalink / raw)
To: Nathan Lynch; +Cc: linux-kernel, frowand.list, robh+dt, devicetree
On Thu, 14 Oct 2021 12:30:23 -0500, Nathan Lynch wrote:
> of_node_is_initialized() and of_node_is_attached() don't modify the node
> objects passed to them, so those parameters should be const.
>
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
> drivers/of/kobj.c | 4 ++--
> drivers/of/of_private.h | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
Applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-20 16:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 17:30 [PATCH] of: kobj: make of_node_is_(initialized|attached) parameters const Nathan Lynch
2021-10-20 16:29 ` Rob Herring
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.