[PATCH 1/2] serial: serial-uclass.c: move definition of _serial_flush up a bit
Rasmus Villemoes
rasmus.villemoes at prevas.dk
Mon Sep 25 13:01:00 CEST 2023
Preparation for next patch.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
---
drivers/serial/serial-uclass.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 067fae2614..2f75ff878c 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -181,6 +181,18 @@ int serial_initialize(void)
return serial_init();
}
+#ifdef CONFIG_CONSOLE_FLUSH_SUPPORT
+static void _serial_flush(struct udevice *dev)
+{
+ struct dm_serial_ops *ops = serial_get_ops(dev);
+
+ if (!ops->pending)
+ return;
+ while (ops->pending(dev, false) > 0)
+ ;
+}
+#endif
+
static void _serial_putc(struct udevice *dev, char ch)
{
struct dm_serial_ops *ops = serial_get_ops(dev);
@@ -234,18 +246,6 @@ static void _serial_puts(struct udevice *dev, const char *str)
} while (*str);
}
-#ifdef CONFIG_CONSOLE_FLUSH_SUPPORT
-static void _serial_flush(struct udevice *dev)
-{
- struct dm_serial_ops *ops = serial_get_ops(dev);
-
- if (!ops->pending)
- return;
- while (ops->pending(dev, false) > 0)
- ;
-}
-#endif
-
static int __serial_getc(struct udevice *dev)
{
struct dm_serial_ops *ops = serial_get_ops(dev);
--
2.37.2
More information about the U-Boot
mailing list