Skip to content

Commit

Permalink
[SPARC64]: constify some paramaters of OF routines
Browse files Browse the repository at this point in the history
This starts bringing the PowerPC and Sparc64 implemetations back closer
together.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Rothwell authored and David S. Miller committed Apr 26, 2007
1 parent 374d4ca commit 3dfe10e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
11 changes: 7 additions & 4 deletions arch/sparc64/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ static struct device_node *allnodes;
*/
static DEFINE_RWLOCK(devtree_lock);

int of_device_is_compatible(struct device_node *device, const char *compat)
int of_device_is_compatible(const struct device_node *device,
const char *compat)
{
const char* cp;
int cplen, l;

cp = (char *) of_get_property(device, "compatible", &cplen);
cp = of_get_property(device, "compatible", &cplen);
if (cp == NULL)
return 0;
while (cplen > 0) {
Expand Down Expand Up @@ -154,7 +155,8 @@ struct device_node *of_find_compatible_node(struct device_node *from,
}
EXPORT_SYMBOL(of_find_compatible_node);

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;
Expand All @@ -174,7 +176,8 @@ EXPORT_SYMBOL(of_find_property);
* Find a property with a given name for a given node
* and return the value.
*/
const void *of_get_property(struct device_node *np, const char *name, int *lenp)
const void *of_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;
Expand Down
10 changes: 6 additions & 4 deletions include/asm-sparc64/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ extern struct device_node *of_find_node_by_phandle(phandle handle);
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 int of_device_is_compatible(struct device_node *device, const char *);
extern const void *of_get_property(struct device_node *node, const char *name,
int *lenp);
extern int of_device_is_compatible(const struct device_node *device,
const char *);
extern const void *of_get_property(const struct device_node *node,
const char *name,
int *lenp);
#define get_property(node,name,lenp) of_get_property(node,name,lenp)
extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
extern int of_getintprop_default(struct device_node *np,
Expand Down

0 comments on commit 3dfe10e

Please sign in to comment.