summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/fdtdec.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 42c3e893d6a..ba5c591489a 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -476,3 +476,27 @@ int fdtdec_setup_gpio(struct fdt_gpio_state *gpio)
return -1;
return 0;
}
+
+int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name,
+ u8 *array, int count)
+{
+ const u8 *cell;
+ int err;
+
+ cell = get_prop_check_min_len(blob, node, prop_name, count, &err);
+ if (!err)
+ memcpy(array, cell, count);
+ return err;
+}
+
+const u8 *fdtdec_locate_byte_array(const void *blob, int node,
+ const char *prop_name, int count)
+{
+ const u8 *cell;
+ int err;
+
+ cell = get_prop_check_min_len(blob, node, prop_name, count, &err);
+ if (err)
+ return NULL;
+ return cell;
+}