diff options
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | 2017-09-21 17:03:09 +0200 |
---|---|---|
committer | Jaehoon Chung <jh80.chung@samsung.com> | 2017-09-22 23:23:54 +0900 |
commit | b5a144a5014be5e3b065e2061a7d17e653d739ae (patch) | |
tree | 159e5c65330d4e5cfff935a50d6030937545dcc8 /drivers/core | |
parent | b24633df31de1b376b7d8fff46540f45d5a352df (diff) |
dm: core: Add functions to get strings and the string count from a stringlist
dev_read_string_count() is used to get the number of strings in a
stringlist.
dev_read_string_index() is used to get a string in the stringlist based on
its position in the list.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Diffstat (limited to 'drivers/core')
-rw-r--r-- | drivers/core/read.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/core/read.c b/drivers/core/read.c index 065589a6abc..eacf1716fd7 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -81,6 +81,17 @@ int dev_read_stringlist_search(struct udevice *dev, const char *property, return ofnode_stringlist_search(dev_ofnode(dev), property, string); } +int dev_read_string_index(struct udevice *dev, const char *propname, int index, + const char **outp) +{ + return ofnode_read_string_index(dev_ofnode(dev), propname, index, outp); +} + +int dev_read_string_count(struct udevice *dev, const char *propname) +{ + return ofnode_read_string_count(dev_ofnode(dev), propname); +} + int dev_read_phandle_with_args(struct udevice *dev, const char *list_name, const char *cells_name, int cell_count, int index, |