]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/of/fdt.c
of: Fix phandle endian issues
[mv-sheeva.git] / drivers / of / fdt.c
index d61fda836e03bacfd7747e3e49f02ae093dc7603..65da5aec7552c70162b6646ded99a32c72797b9d 100644 (file)
@@ -169,7 +169,7 @@ int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
        if (cp == NULL)
                return 0;
        while (cplen > 0) {
-               if (strncasecmp(cp, compat, strlen(compat)) == 0)
+               if (of_compat_cmp(cp, compat, strlen(compat)) == 0)
                        return 1;
                l = strlen(cp) + 1;
                cp += l;
@@ -320,13 +320,13 @@ unsigned long __init unflatten_dt_node(unsigned long mem,
                        if ((strcmp(pname, "phandle") == 0) ||
                            (strcmp(pname, "linux,phandle") == 0)) {
                                if (np->phandle == 0)
-                                       np->phandle = *((u32 *)*p);
+                                       np->phandle = be32_to_cpup((__be32*)*p);
                        }
                        /* And we process the "ibm,phandle" property
                         * used in pSeries dynamic device tree
                         * stuff */
                        if (strcmp(pname, "ibm,phandle") == 0)
-                               np->phandle = *((u32 *)*p);
+                               np->phandle = be32_to_cpup((__be32 *)*p);
                        pp->name = pname;
                        pp->length = sz;
                        pp->value = (void *)*p;