]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
serial: Drop ns16550 serial_getinfo() in SPL
authorSimon Glass <sjg@chromium.org>
Tue, 26 Sep 2023 14:14:56 +0000 (08:14 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 6 Oct 2023 18:38:13 +0000 (14:38 -0400)
This is typically not needed in SPL/TPL and increases the code size.
Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/serial/ns16550.c

index eab9537fbae52f972dea1e54aff66e640a70499c..5ca2828ae8536999d565294b970447b456b3da8b 100644 (file)
@@ -13,6 +13,7 @@
 #include <ns16550.h>
 #include <reset.h>
 #include <serial.h>
+#include <spl.h>
 #include <watchdog.h>
 #include <asm/global_data.h>
 #include <linux/err.h>
@@ -472,6 +473,10 @@ static int ns16550_serial_getinfo(struct udevice *dev,
        struct ns16550 *const com_port = dev_get_priv(dev);
        struct ns16550_plat *plat = com_port->plat;
 
+       /* save code size */
+       if (!spl_in_proper())
+               return -ENOSYS;
+
        info->type = SERIAL_CHIP_16550_COMPATIBLE;
 #ifdef CONFIG_SYS_NS16550_PORT_MAPPED
        info->addr_space = SERIAL_ADDRESS_SPACE_IO;