]> xenbits.xensource.com Git - people/aperard/xen-arm.git/commitdiff
xen/arm: use strcmp in device_tree_type_matches
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 13 Dec 2012 11:44:01 +0000 (11:44 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 13 Dec 2012 11:44:01 +0000 (11:44 +0000)
We want to match the exact string rather than the first subset.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/common/device_tree.c

index 7a072cb930ad57cf568138252beb2a9dbb54e19d..8b4ef2f45c67839341dbc80b8d9ab612f6cb2d38 100644 (file)
@@ -44,14 +44,13 @@ bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
 
 bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
 {
-    int len;
     const void *prop;
 
-    prop = fdt_getprop(fdt, node, "device_type", &len);
+    prop = fdt_getprop(fdt, node, "device_type", NULL);
     if ( prop == NULL )
         return 0;
 
-    return !strncmp(prop, match, len);
+    return !strcmp(prop, match);
 }
 
 bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)