Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2100efb authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Paul Mackerras
Browse files

[POWERPC] Fix device_is_compatible() const warning



Fix a const'ification related warning with device_is_compatible()
and friends related to get_property() not properly having const
on it's input device node argument.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 859deea9
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1014,7 +1014,7 @@ EXPORT_SYMBOL(find_all_nodes);
/** Checks if the given "compat" string matches one of the strings in
 * the device's "compatible" property
 */
int device_is_compatible(struct device_node *device, const char *compat)
int device_is_compatible(const struct device_node *device, const char *compat)
{
	const char* cp;
	int cplen, l;
@@ -1491,7 +1491,8 @@ static int __init prom_reconfig_setup(void)
__initcall(prom_reconfig_setup);
#endif

struct property *of_find_property(struct device_node *np, const char *name,
struct property *of_find_property(const struct device_node *np,
				  const char *name,
				  int *lenp)
{
	struct property *pp;
@@ -1512,7 +1513,8 @@ struct property *of_find_property(struct device_node *np, const char *name,
 * Find a property with a given name for a given node
 * and return the value.
 */
const void *get_property(struct device_node *np, const char *name, int *lenp)
const void *get_property(const struct device_node *np, const char *name,
			 int *lenp)
{
	struct property *pp = of_find_property(np,name,lenp);
	return pp ? pp->value : NULL;
+6 −4
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ extern struct device_node *of_find_all_nodes(struct device_node *prev);
extern struct device_node *of_get_parent(const struct device_node *node);
extern struct device_node *of_get_next_child(const struct device_node *node,
					     struct device_node *prev);
extern struct property *of_find_property(struct device_node *np,
extern struct property *of_find_property(const struct device_node *np,
					 const char *name,
					 int *lenp);
extern struct device_node *of_node_get(struct device_node *node);
@@ -158,9 +158,11 @@ extern void of_detach_node(const struct device_node *);
extern void finish_device_tree(void);
extern void unflatten_device_tree(void);
extern void early_init_devtree(void *);
extern int device_is_compatible(struct device_node *device, const char *);
extern int device_is_compatible(const struct device_node *device,
				const char *);
extern int machine_is_compatible(const char *compat);
extern const void *get_property(struct device_node *node, const char *name,
extern const void *get_property(const struct device_node *node,
				const char *name,
				int *lenp);
extern void print_properties(struct device_node *node);
extern int prom_n_addr_cells(struct device_node* np);