diff mbox series

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

Message ID 20200421140840.25729-2-patrice.chotard@st.com
State New
Headers show
Series cmd: bind allow to bind driver with driver_data | expand

Commit Message

Patrice CHOTARD April 21, 2020, 2:08 p.m. UTC
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(-)

Comments

Simon Glass April 21, 2020, 5:36 p.m. UTC | #1
Hi Patrice,

On Tue, 21 Apr 2020 at 08:09, Patrice Chotard <patrice.chotard at st.com> wrote:
>
> 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(-)
>

Please see my comment on the other patch.

Regards,
Simon
diff mbox series

Patch

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
  *