diff options
author | Simon Glass <sjg@chromium.org> | 2021-08-07 07:24:01 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-09-25 09:46:15 -0600 |
commit | 7de8bd03c37af6120cf5bba9bf1adb492ed56868 (patch) | |
tree | 03d977384b888feedf77e0d274f7682d732d6be9 /lib | |
parent | bb38d77ca779cc8bdad3d4ceb6cecc687f4987c2 (diff) | |
download | u-boot-7de8bd03c37af6120cf5bba9bf1adb492ed56868.tar.gz u-boot-7de8bd03c37af6120cf5bba9bf1adb492ed56868.tar.bz2 u-boot-7de8bd03c37af6120cf5bba9bf1adb492ed56868.zip |
treewide: fdt: Move fdt_get_config_... to ofnode_conf_read...
The current API is outdated as it requires a devicetree pointer.
Move these functions to use the ofnode API and update this globally. Add
some tests while we are here.
Correct the call in exynos_dsim_config_parse_dt() which is obviously
wrong.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fdtdec.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 7358cb6dd1..af92e65bde 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -870,50 +870,6 @@ const u8 *fdtdec_locate_byte_array(const void *blob, int node, return cell; } -int fdtdec_get_config_int(const void *blob, const char *prop_name, - int default_val) -{ - int config_node; - - debug("%s: %s\n", __func__, prop_name); - config_node = fdt_path_offset(blob, "/config"); - if (config_node < 0) - return default_val; - 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; - int nodeoffset; - int len; - - debug("%s: %s\n", __func__, prop_name); - nodeoffset = fdt_path_offset(blob, "/config"); - if (nodeoffset < 0) - return NULL; - - nodep = fdt_getprop(blob, nodeoffset, prop_name, &len); - if (!nodep) - return NULL; - - return (char *)nodep; -} - u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells) { u64 number = 0; |