aboutsummaryrefslogtreecommitdiff
path: root/pylibfdt/libfdt.i
diff options
context:
space:
mode:
Diffstat (limited to 'pylibfdt/libfdt.i')
-rw-r--r--pylibfdt/libfdt.i11
1 files changed, 7 insertions, 4 deletions
diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
index f9f7e7e..2361e22 100644
--- a/pylibfdt/libfdt.i
+++ b/pylibfdt/libfdt.i
@@ -443,11 +443,12 @@ class FdtRo(object):
"""
return fdt_get_alias(self._fdt, name)
- def get_path(self, nodeoffset, quiet=()):
+ def get_path(self, nodeoffset, size_hint=1024, quiet=()):
"""Get the full path of a node
Args:
nodeoffset: Node offset to check
+ size_hint: Hint for size of returned string
Returns:
Full path to the node
@@ -455,11 +456,10 @@ class FdtRo(object):
Raises:
FdtException if an error occurs
"""
- size = 1024
while True:
- ret, path = fdt_get_path(self._fdt, nodeoffset, size)
+ ret, path = fdt_get_path(self._fdt, nodeoffset, size_hint)
if ret == -NOSPACE:
- size = size * 2
+ size_hint *= 2
continue
err = check_err(ret, quiet)
if err:
@@ -1036,6 +1036,9 @@ class NodeAdder():
%rename(fdt_property) fdt_property_func;
+%immutable fdt_property::data;
+%immutable fdt_node_header::name;
+
/*
* fdt32_t is a big-endian 32-bit value defined to uint32_t in libfdt_env.h
* so use the same type here.