[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v01 1/3] xen:dt: add match for non-available nodes



From: Andrii Anisov <andrii.anisov@xxxxxxxxxxxxxxx>

Signed-off-by: Andrii Anisov <andrii.anisov@xxxxxxxxxxxxxxx>
---
 xen/common/device_tree.c      |    6 +++++-
 xen/include/xen/device_tree.h |    2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 55716a8..f0bd7b9 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -692,7 +692,8 @@ bool_t dt_match_node(const struct dt_device_match *matches,
     if ( !matches )
         return 0;
 
-    while ( matches->path || matches->type || matches->compatible )
+    while ( matches->path || matches->type ||
+            matches->compatible || matches->nav)
     {
         bool_t match = 1;
 
@@ -705,6 +706,9 @@ bool_t dt_match_node(const struct dt_device_match *matches,
         if ( matches->compatible )
             match &= dt_device_is_compatible(node, matches->compatible);
 
+        if ( matches->nav )
+            match &= !dt_device_is_available(node);
+
         if ( match )
             return match;
 
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 9a8c3de..99de53f 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -62,11 +62,13 @@ struct dt_device_match {
     const char *path;
     const char *type;
     const char *compatible;
+    int        nav;
 };
 
 #define DT_MATCH_PATH(p)                { .path = p }
 #define DT_MATCH_TYPE(typ)              { .type = typ }
 #define DT_MATCH_COMPATIBLE(compat)     { .compatible = compat }
+#define DT_MATCH_NOT_AVAILABLE()        { .nav = 1 }
 
 typedef u32 dt_phandle;
 
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.