summaryrefslogtreecommitdiff
path: root/tools/dtoc/fdt_util.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-03-05 20:18:52 -0700
committerSimon Glass <sjg@chromium.org>2022-03-18 19:24:24 -0600
commit61012538184540b60b35eeb8e5654bfbcd0dbf32 (patch)
treea58a58e381bde5a6a5333411ef078d2b3b00eb8c /tools/dtoc/fdt_util.py
parent04fce6ff705c455241a180495043c8cd4c4ad81e (diff)
dtoc: Make GetArgs() more flexible
At present it is not possible to have arguments which include spaces. Update the function to only split the args if the property is a single string. This is a bit inconsistent, but might still be useful. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Diffstat (limited to 'tools/dtoc/fdt_util.py')
-rw-r--r--tools/dtoc/fdt_util.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/dtoc/fdt_util.py b/tools/dtoc/fdt_util.py
index c82e7747aa3..57550624bbf 100644
--- a/tools/dtoc/fdt_util.py
+++ b/tools/dtoc/fdt_util.py
@@ -192,8 +192,12 @@ def GetArgs(node, propname):
value = GetStringList(node, propname)
else:
value = []
- lists = [v.split() for v in value]
- args = [x for l in lists for x in l]
+ if not value:
+ args = []
+ elif len(value) == 1:
+ args = value[0].split()
+ else:
+ args = value
return args
def GetBool(node, propname, default=False):