of: Add helpers to get one string in multiple strings property
Add of_property_read_string_index and of_property_count_strings to retrieve one string inside a property that will contains severals strings. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Kevin Hilman <khilman@ti.com>
This commit is contained in:
committed by
Kevin Hilman
parent
f718e2c034
commit
4fcd15a032
@ -203,6 +203,11 @@ extern int of_property_read_u32_array(const struct device_node *np,
|
||||
extern int of_property_read_string(struct device_node *np,
|
||||
const char *propname,
|
||||
const char **out_string);
|
||||
extern int of_property_read_string_index(struct device_node *np,
|
||||
const char *propname,
|
||||
int index, const char **output);
|
||||
extern int of_property_count_strings(struct device_node *np,
|
||||
const char *propname);
|
||||
extern int of_device_is_compatible(const struct device_node *device,
|
||||
const char *);
|
||||
extern int of_device_is_available(const struct device_node *device);
|
||||
@ -256,6 +261,19 @@ static inline int of_property_read_string(struct device_node *np,
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int of_property_read_string_index(struct device_node *np,
|
||||
const char *propname, int index,
|
||||
const char **out_string)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int of_property_count_strings(struct device_node *np,
|
||||
const char *propname)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline const void *of_get_property(const struct device_node *node,
|
||||
const char *name,
|
||||
int *lenp)
|
||||
|
Reference in New Issue
Block a user