]> git.sur5r.net Git - u-boot/blobdiff - drivers/serial/serial-uclass.c
Merge branch 'master' of git://git.denx.de/u-boot-usb
[u-boot] / drivers / serial / serial-uclass.c
index 842f78bff3c3863c20834cda5c49f08cef4a2c25..1c447ff27aa17d12435c48b62df8e490dc55b1ae 100644 (file)
@@ -64,9 +64,9 @@ static void serial_find_console_or_panic(void)
                }
 
                /*
-               * If the console is not marked to be bound before relocation,
-               * bind it anyway.
-               */
+                * If the console is not marked to be bound before relocation,
+                * bind it anyway.
+                */
                if (node > 0 &&
                    !lists_bind_fdt(gd->dm_root, blob, node, &dev)) {
                        if (!device_probe(dev)) {
@@ -77,13 +77,13 @@ static void serial_find_console_or_panic(void)
        }
        if (!SPL_BUILD || !CONFIG_IS_ENABLED(OF_CONTROL) || !blob) {
                /*
-               * Try to use CONFIG_CONS_INDEX if available (it is numbered
-               * from 1!).
-               *
-               * Failing that, get the device with sequence number 0, or in
-               * extremis just the first serial device we can find. But we
-               * insist on having a console (even if it is silent).
-               */
+                * Try to use CONFIG_CONS_INDEX if available (it is numbered
+                * from 1!).
+                *
+                * Failing that, get the device with sequence number 0, or in
+                * extremis just the first serial device we can find. But we
+                * insist on having a console (even if it is silent).
+                */
 #ifdef CONFIG_CONS_INDEX
 #define INDEX (CONFIG_CONS_INDEX - 1)
 #else
@@ -204,7 +204,7 @@ void serial_stdio_init(void)
 {
 }
 
-#ifdef CONFIG_DM_STDIO
+#if defined(CONFIG_DM_STDIO) && CONFIG_IS_ENABLED(SERIAL_PRESENT)
 static void serial_stub_putc(struct stdio_dev *sdev, const char ch)
 {
        _serial_putc(sdev->priv, ch);
@@ -287,6 +287,7 @@ static int on_baudrate(const char *name, const char *value, enum env_op op,
 }
 U_BOOT_ENV_CALLBACK(baudrate, on_baudrate);
 
+#if CONFIG_IS_ENABLED(SERIAL_PRESENT)
 static int serial_post_probe(struct udevice *dev)
 {
        struct dm_serial_ops *ops = serial_get_ops(dev);
@@ -356,3 +357,4 @@ UCLASS_DRIVER(serial) = {
        .pre_remove     = serial_pre_remove,
        .per_device_auto_alloc_size = sizeof(struct serial_dev_priv),
 };
+#endif