aboutsummaryrefslogtreecommitdiff
path: root/drivers/core/read.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-10-23 17:26:07 -0600
committerSimon Glass <sjg@chromium.org>2021-11-28 16:51:51 -0700
commit075bfc9575aedca15e61f5f1cfa300409e2979fe (patch)
treef75d1acaafdef7a48bd225151a361bd25fdb021e /drivers/core/read.c
parent32c6a8e1f803e2a42fa7bf76f23231736841bfc0 (diff)
dm: core: Add a way to obtain a string list
At present we support reading a string list a string at a time. Apart from being inefficient, this makes it impossible to separate reading of the devicetree into the of_to_plat() method where it belongs, since any code which needs access to the string must read it from the devicetree. Add a function which returns the string property as an array of pointers to the strings, which is easily used by clients. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/read.c')
-rw-r--r--drivers/core/read.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/core/read.c b/drivers/core/read.c
index 4307ca4579..31f9e78a06 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -205,6 +205,12 @@ int dev_read_string_count(const struct udevice *dev, const char *propname)
return ofnode_read_string_count(dev_ofnode(dev), propname);
}
+int dev_read_string_list(const struct udevice *dev, const char *propname,
+ const char ***listp)
+{
+ return ofnode_read_string_list(dev_ofnode(dev), propname, listp);
+}
+
int dev_read_phandle_with_args(const struct udevice *dev, const char *list_name,
const char *cells_name, int cell_count,
int index, struct ofnode_phandle_args *out_args)