Commit 6effc885 authored by Nathan Lynch's avatar Nathan Lynch Committed by Rob Herring

of: kobj: make of_node_is_(initialized|attached) parameters const

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: default avatarNathan Lynch <nathanl@linux.ibm.com>
Link: https://lore.kernel.org/r/20211014173023.2117799-1-nathanl@linux.ibm.comSigned-off-by: default avatarRob Herring <robh@kernel.org>
parent 7688fa10
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
#include "of_private.h" #include "of_private.h"
/* true when node is initialized */ /* 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; return node && node->kobj.state_initialized;
} }
/* true when node is attached (i.e. present on sysfs) */ /* 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; return node && node->kobj.state_in_sysfs;
} }
......
...@@ -60,7 +60,7 @@ static inline int of_property_notify(int action, struct device_node *np, ...@@ -60,7 +60,7 @@ static inline int of_property_notify(int action, struct device_node *np,
#endif /* CONFIG_OF_DYNAMIC */ #endif /* CONFIG_OF_DYNAMIC */
#if defined(CONFIG_OF_KOBJ) #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); 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_remove_property_sysfs(struct device_node *np, struct property *prop);
void __of_update_property_sysfs(struct device_node *np, struct property *newprop, void __of_update_property_sysfs(struct device_node *np, struct property *newprop,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment