]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
of/fdt: remove unused of_scan_flat_dt_by_path
authorRob Herring <robh@kernel.org>
Sat, 29 Mar 2014 19:14:17 +0000 (14:14 -0500)
committerRob Herring <robh@kernel.org>
Wed, 30 Apr 2014 05:59:14 +0000 (00:59 -0500)
of_scan_flat_dt_by_path is unused anywhere in the kernel, so remove it.

Signed-off-by: Rob Herring <robh@kernel.org>
Tested-by: Michal Simek <michal.simek@xilinx.com>
Tested-by: Grant Likely <grant.likely@linaro.org>
Tested-by: Stephen Chivers <schivers@csc.com>
drivers/of/fdt.c
include/linux/of_fdt.h

index 63bdcee473faa7c1b4055bc6e77b4bb6c338ddeb..9c85352919091f66496489b12a6997b83ec0dfe7 100644 (file)
@@ -671,73 +671,6 @@ struct fdt_scan_status {
        void *data;
 };
 
-/**
- * fdt_scan_node_by_path - iterator for of_scan_flat_dt_by_path function
- */
-static int __init fdt_scan_node_by_path(unsigned long node, const char *uname,
-                                       int depth, void *data)
-{
-       struct fdt_scan_status *st = data;
-
-       /*
-        * if scan at the requested fdt node has been completed,
-        * return -ENXIO to abort further scanning
-        */
-       if (depth <= st->depth)
-               return -ENXIO;
-
-       /* requested fdt node has been found, so call iterator function */
-       if (st->found)
-               return st->iterator(node, uname, depth, st->data);
-
-       /* check if scanning automata is entering next level of fdt nodes */
-       if (depth == st->depth + 1 &&
-           strncmp(st->name, uname, st->namelen) == 0 &&
-           uname[st->namelen] == 0) {
-               st->depth += 1;
-               if (st->name[st->namelen] == 0) {
-                       st->found = 1;
-               } else {
-                       const char *next = st->name + st->namelen + 1;
-                       st->name = next;
-                       st->namelen = strcspn(next, "/");
-               }
-               return 0;
-       }
-
-       /* scan next fdt node */
-       return 0;
-}
-
-/**
- * of_scan_flat_dt_by_path - scan flattened tree blob and call callback on each
- *                          child of the given path.
- * @path: path to start searching for children
- * @it: callback function
- * @data: context data pointer
- *
- * This function is used to scan the flattened device-tree starting from the
- * node given by path. It is used to extract information (like reserved
- * memory), which is required on ealy boot before we can unflatten the tree.
- */
-int __init of_scan_flat_dt_by_path(const char *path,
-       int (*it)(unsigned long node, const char *name, int depth, void *data),
-       void *data)
-{
-       struct fdt_scan_status st = {path, 0, -1, 0, it, data};
-       int ret = 0;
-
-       if (initial_boot_params)
-                ret = of_scan_flat_dt(fdt_scan_node_by_path, &st);
-
-       if (!st.found)
-               return -ENOENT;
-       else if (ret == -ENXIO) /* scan has been completed */
-               return 0;
-       else
-               return ret;
-}
-
 const char * __init of_flat_dt_get_machine_name(void)
 {
        const char *name;
index d4d0efe534b9835bc24448fe6bbb1d84855623a3..991ec74b4e1174a43525453a4bcec83aeef93137 100644 (file)
@@ -93,9 +93,6 @@ extern void *of_get_flat_dt_prop(unsigned long node, const char *name,
 extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
 extern int of_flat_dt_match(unsigned long node, const char *const *matches);
 extern unsigned long of_get_flat_dt_root(void);
-extern int of_scan_flat_dt_by_path(const char *path,
-       int (*it)(unsigned long node, const char *name, int depth, void *data),
-       void *data);
 
 extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
                                     int depth, void *data);