From 7de8bd03c37af6120cf5bba9bf1adb492ed56868 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 7 Aug 2021 07:24:01 -0600 Subject: 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 --- lib/fdtdec.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'lib') 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; -- cgit v1.2.3