U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Stephan <jstephan@baylibre.com>
To: u-boot@lists.u-boot-project.org
Cc: GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
	 Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	 Julien Stephan <jstephan@baylibre.com>,
	 "Markus Schneider-Pargmann (TI)" <msp@baylibre.com>,
	dlechner@baylibre.com
Subject: [PATCH v2 2/3] dm: uclass: use dm_err() for a missing uclass
Date: Mon, 24 Aug 2026 10:44:17 +0200	[thread overview]
Message-ID: <20260824-improve-logging-on-missing-uclass-v2-2-4bee2cdff72b@baylibre.com> (raw)
In-Reply-To: <20260824-improve-logging-on-missing-uclass-v2-0-4bee2cdff72b@baylibre.com>

When a uclass definition is missing for an enabled driver, the board
cannot boot, and without any extra debug option enabled the only output
is an obscure message with no hint about the root cause:

  initcall_run_r(): initcall initr_dm() failed
  ### ERROR ### Please RESET the board ###

The existing message used dm_warn(), which is not shown by default. Since
this is a fatal error preventing the board from booting, use the new
dm_err() helper so it is emitted at ERROR level and visible by default.
Shorten the message as well to limit the code size overhead.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
---
 drivers/core/uclass.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 5365ac68f9e..83a67dfb4de 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -60,8 +60,7 @@ static int uclass_add(enum uclass_id id, struct uclass **ucp)
 	*ucp = NULL;
 	uc_drv = lists_uclass_lookup(id);
 	if (!uc_drv) {
-		dm_warn("Cannot find uclass for id %d: please add the UCLASS_DRIVER() declaration for this UCLASS_... id\n",
-			id);
+		dm_err("uclass %d: no UCLASS_DRIVER()\n", id);
 		/*
 		 * Use a strange error to make this case easier to find. When
 		 * a uclass is not available it can prevent driver model from

-- 
2.54.0


  parent reply	other threads:[~2026-08-24  8:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24  8:44 [PATCH v2 0/3] Improve logging on missing uclass Julien Stephan
2026-08-24  8:44 ` [PATCH v2 1/3] dm: add dm_err() and a driver model log verbosity choice Julien Stephan
2026-08-24  8:44 ` Julien Stephan [this message]
2026-08-24  8:44 ` [PATCH v2 3/3] initcall: initcall_evt: display error code on error Julien Stephan
2026-09-03 22:56 ` [PATCH v2 0/3] Improve logging on missing uclass Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260824-improve-logging-on-missing-uclass-v2-2-4bee2cdff72b@baylibre.com \
    --to=jstephan@baylibre.com \
    --cc=GSS_MTK_Uboot_upstream@mediatek.com \
    --cc=dlechner@baylibre.com \
    --cc=msp@baylibre.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox