diff mbox series

[v2,1/4] dm: core: fix misleading debug message when matching compatible

Message ID 20240611-misc-20240610-v2-1-028e82b0b620@cherry.de
State Accepted
Commit cc560eac51ea19742f4ea166b86a34b1c7ceb31a
Delegated to: Simon Glass
Headers show
Series dm: core: fix several debug messages and migrate debug() to dm_warn | expand

Commit Message

Quentin Schulz June 11, 2024, 1:04 p.m. UTC
From: Quentin Schulz <quentin.schulz@cherry.de>

A driver can have multiple compatible. When the id->compatible matches
for that driver, the first compatible supported by the driver is
currently returned, which gives the following confusing message:

   - found match at 'rk3588_syscon': 'rockchip,rk3588-sys-grf' matches 'rockchip,rk3588-pmugrf'

Considering that the compatible passed in argument is necessarily the
one that exactly matched to enter this code path, there's no need to do
some elaborate logic, just print the driver name and the compatible
passed in argument.

Fixes: d3e773613b6d ("dm: core: Use U-Boot logging instead of pr_debug()")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 drivers/core/lists.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Simon Glass June 11, 2024, 6:51 p.m. UTC | #1
On Tue, 11 Jun 2024 at 07:04, Quentin Schulz <foss+uboot@0leil.net> wrote:
>
> From: Quentin Schulz <quentin.schulz@cherry.de>
>
> A driver can have multiple compatible. When the id->compatible matches
> for that driver, the first compatible supported by the driver is
> currently returned, which gives the following confusing message:
>
>    - found match at 'rk3588_syscon': 'rockchip,rk3588-sys-grf' matches 'rockchip,rk3588-pmugrf'
>
> Considering that the compatible passed in argument is necessarily the
> one that exactly matched to enter this code path, there's no need to do
> some elaborate logic, just print the driver name and the compatible
> passed in argument.
>
> Fixes: d3e773613b6d ("dm: core: Use U-Boot logging instead of pr_debug()")
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
> ---
>  drivers/core/lists.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 2839a9b7371..942fe4a4e67 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -246,9 +246,8 @@  int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
 		}
 
 		if (entry->of_match)
-			log_debug("   - found match at '%s': '%s' matches '%s'\n",
-				  entry->name, entry->of_match->compatible,
-				  id->compatible);
+			log_debug("   - found match at driver '%s' for '%s'\n",
+				  entry->name, id->compatible);
 		ret = device_bind_with_driver_data(parent, entry, name,
 						   id ? id->data : 0, node,
 						   &dev);