We want to match the exact string rather than the first subset.
Changes in v4:
- get rid of len.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
xen/common/device_tree.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 7a072cb..8b4ef2f 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -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)
--
1.7.2.5
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Changes in v4:
- get rid of len.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
xen/common/device_tree.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 7a072cb..8b4ef2f 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -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)
--
1.7.2.5
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel