diff options
Diffstat (limited to 'drivers/core/of_access.c')
-rw-r--r-- | drivers/core/of_access.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c index c54baa140a..ea3ee8bd63 100644 --- a/drivers/core/of_access.c +++ b/drivers/core/of_access.c @@ -171,6 +171,38 @@ const void *of_get_property(const struct device_node *np, const char *name, return pp ? pp->value : NULL; } +const struct property *of_get_first_property(const struct device_node *np) +{ + if (!np) + return NULL; + + return np->properties; +} + +const struct property *of_get_next_property(const struct device_node *np, + const struct property *property) +{ + if (!np) + return NULL; + + return property->next; +} + +const void *of_get_property_by_prop(const struct device_node *np, + const struct property *property, + const char **name, + int *lenp) +{ + if (!np || !property) + return NULL; + if (name) + *name = property->name; + if (lenp) + *lenp = property->length; + + return property->value; +} + static const char *of_prop_next_string(struct property *prop, const char *cur) { const void *curv = cur; |