Merge tag 'powerpc-6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux-2.6-block.git] / include / linux / of.h
index 4f24e33d67a602570306659bf1984e0863f2274f..df702b2c2ae3a61f465331c073118d3779b89250 100644 (file)
@@ -398,7 +398,20 @@ extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
 extern int of_alias_get_id(struct device_node *np, const char *stem);
 extern int of_alias_get_highest_id(const char *stem);
 
-extern int of_machine_is_compatible(const char *compat);
+bool of_machine_compatible_match(const char *const *compats);
+
+/**
+ * of_machine_is_compatible - Test root of device tree for a given compatible value
+ * @compat: compatible string to look for in root node's compatible property.
+ *
+ * Return: true if the root node has the given value in its compatible property.
+ */
+static inline bool of_machine_is_compatible(const char *compat)
+{
+       const char *compats[] = { compat, NULL };
+
+       return of_machine_compatible_match(compats);
+}
 
 extern int of_add_property(struct device_node *np, struct property *prop);
 extern int of_remove_property(struct device_node *np, struct property *prop);
@@ -805,6 +818,11 @@ static inline int of_remove_property(struct device_node *np, struct property *pr
        return 0;
 }
 
+static inline bool of_machine_compatible_match(const char *const *compats)
+{
+       return false;
+}
+
 static inline bool of_console_check(const struct device_node *dn, const char *name, int index)
 {
        return false;