diff options
author | Gabe Black <gabeblack@chromium.org> | 2012-10-25 16:31:04 +0000 |
---|---|---|
committer | Gerald Van Baren <gvb@unssw.com> | 2012-11-12 23:14:57 -0500 |
commit | 79289c0b5ff4a8c7869d7ca629cddc660dd06095 (patch) | |
tree | 8904a22ba56463d5ed9b3aef3f15765eded700d4 /lib/fdtdec.c | |
parent | 7cde397b21a347134a39c40e24355a0e438adae3 (diff) |
fdt: Add function to read boolean property
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/fdtdec.c')
-rw-r--r-- | lib/fdtdec.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 96f3e7bccf4..da12df209c9 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -524,6 +524,20 @@ int fdtdec_get_config_int(const void *blob, const char *prop_name, return fdtdec_get_int(blob, config_node, prop_name, default_val); } +int fdtdec_get_config_bool(const void *blob, const char *prop_name) +{ + int config_node; + const void *prop; + + debug("%s: %s\n", __func__, prop_name); + config_node = fdt_path_offset(blob, "/config"); + if (config_node < 0) + return 0; + prop = fdt_get_property(blob, config_node, prop_name, NULL); + + return prop != NULL; +} + char *fdtdec_get_config_string(const void *blob, const char *prop_name) { const char *nodep; |