]> git.sur5r.net Git - u-boot/blobdiff - lib/libfdt/fdt_ro.c
Merge branch 'master' of git://www.denx.de/git/u-boot-imx
[u-boot] / lib / libfdt / fdt_ro.c
index 44fc0aa900d2556996ab5f9ef7c87f12fca517ce..12214c2dc2b58473707a3052a64a6d43b4ca157f 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  * SPDX-License-Identifier:    GPL-2.0+ BSD-2-Clause
  */
-#include "libfdt_env.h"
+#include <libfdt_env.h>
 
 #ifndef USE_HOSTCC
 #include <fdt.h>
@@ -19,7 +19,7 @@ static int _fdt_nodename_eq(const void *fdt, int offset,
 {
        const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1);
 
-       if (! p)
+       if (!p)
                /* short match */
                return 0;
 
@@ -115,7 +115,7 @@ int fdt_subnode_offset(const void *fdt, int parentoffset,
 
 /*
  * Find the next of path seperator, note we need to search for both '/' and ':'
- * and then take the first one so that we do the rigth thing for e.g.
+ * and then take the first one so that we do the right thing for e.g.
  * "foo/bar:option" and "bar:option/otheroption", both of which happen, so
  * first searching for either ':' or '/' does not work.
  */
@@ -163,7 +163,7 @@ int fdt_path_offset(const void *fdt, const char *path)
                if (*p == '\0' || *p == ':')
                        return offset;
                q = fdt_path_next_seperator(p);
-               if (! q)
+               if (!q)
                        q = end;
 
                offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p);
@@ -273,7 +273,7 @@ const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
        const struct fdt_property *prop;
 
        prop = fdt_get_property_namelen(fdt, nodeoffset, name, namelen, lenp);
-       if (! prop)
+       if (!prop)
                return NULL;
 
        return prop->data;
@@ -517,7 +517,7 @@ int fdt_count_strings(const void *fdt, int node, const char *property)
 
        list = fdt_getprop(fdt, node, property, &length);
        if (!list)
-               return -length;
+               return length;
 
        for (i = 0; i < length; i++) {
                int len = strlen(list);
@@ -577,7 +577,7 @@ int fdt_get_string_index(const void *fdt, int node, const char *property,
                index--;
        }
 
-       return FDT_ERR_NOTFOUND;
+       return -FDT_ERR_NOTFOUND;
 }
 
 int fdt_get_string(const void *fdt, int node, const char *property,