]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
serial: ns16550: Fix an "unused" warning with SERIAL_PRESENT=n and OF_REAL=y
authorTom Rini <trini@konsulko.com>
Mon, 23 Mar 2026 19:53:04 +0000 (13:53 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 7 Apr 2026 17:32:46 +0000 (11:32 -0600)
The definition of our ID table is guarded with OF_REAL however the
U_BOOT_DRIVER that would in turn use the table is guarded with
SERIAL_PRESENT. To avoid a potential warning we must also guard the
ID table with SERIAL_PRESENT.

Signed-off-by: Tom Rini <trini@konsulko.com>
drivers/serial/ns16550.c

index 2f24f47badfd12ac459b369dd279e0c4a7fa5cab..10271f46aa639e3b9da619b1de2a9c17e80c1c64 100644 (file)
@@ -586,6 +586,7 @@ const struct dm_serial_ops ns16550_serial_ops = {
        .getinfo = ns16550_serial_getinfo,
 };
 
+#if CONFIG_IS_ENABLED(SERIAL_PRESENT)
 #if CONFIG_IS_ENABLED(OF_REAL)
 /*
  * Please consider existing compatible strings before adding a new
@@ -603,8 +604,6 @@ static const struct udevice_id ns16550_serial_ids[] = {
 };
 #endif /* OF_REAL */
 
-#if CONFIG_IS_ENABLED(SERIAL_PRESENT)
-
 /* TODO(sjg@chromium.org): Integrate this into a macro like CONFIG_IS_ENABLED */
 #if !defined(CONFIG_TPL_BUILD) || defined(CONFIG_TPL_DM_SERIAL)
 U_BOOT_DRIVER(ns16550_serial) = {