[PATCH v1 1/2] dm: core: give access to driver_check_compatible()

Patrice Chotard patrice.chotard at st.com
Tue Apr 21 16:08:38 CEST 2020


driver_check_compatible() can be useful in particular case,
give access to this primitive

Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
Cc: Jean-Jacques Hiblot <jjhiblot at ti.com>
---

 drivers/core/lists.c |  6 +++---
 include/dm/lists.h   | 12 ++++++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 68204c303f..c807cf8698 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -106,9 +106,9 @@ int device_bind_driver_to_node(struct udevice *parent, const char *drv_name,
  * @param compat:	The compatible string to search for
  * @return 0 if there is a match, -ENOENT if no match
  */
-static int driver_check_compatible(const struct udevice_id *of_match,
-				   const struct udevice_id **of_idp,
-				   const char *compat)
+int driver_check_compatible(const struct udevice_id *of_match,
+			    const struct udevice_id **of_idp,
+			    const char *compat)
 {
 	if (!of_match)
 		return -ENOENT;
diff --git a/include/dm/lists.h b/include/dm/lists.h
index 810e244d9e..7615f0ab38 100644
--- a/include/dm/lists.h
+++ b/include/dm/lists.h
@@ -44,6 +44,18 @@ struct uclass_driver *lists_uclass_lookup(enum uclass_id id);
  */
 int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only);
 
+/**
+ * driver_check_compatible() - Check if a driver matches a compatible string
+ *
+ * @param of_match:	List of compatible strings to match
+ * @param of_idp:	Returns the match that was found
+ * @param compat:	The compatible string to search for
+ * @return 0 if there is a match, -ENOENT if no match
+ */
+int driver_check_compatible(const struct udevice_id *of_match,
+			    const struct udevice_id **of_idp,
+			    const char *compat);
+
 /**
  * lists_bind_fdt() - bind a device tree node
  *
-- 
2.17.1



More information about the U-Boot mailing list