summaryrefslogtreecommitdiff
path: root/drivers/core/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/core/device.c')
-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 5c2dc70..45d5e3e 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);
+}