aboutsummaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/device.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 5c2dc7021fb..45d5e3e12c0 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -721,3 +721,17 @@ int device_set_name(struct udevice *dev, const char *name)
return 0;
}
+
+bool of_device_is_compatible(struct udevice *dev, const char *compat)
+{
+ const void *fdt = gd->fdt_blob;
+
+ return !fdt_node_check_compatible(fdt, dev->of_offset, compat);
+}
+
+bool of_machine_is_compatible(const char *compat)
+{
+ const void *fdt = gd->fdt_blob;
+
+ return !fdt_node_check_compatible(fdt, 0, compat);
+}