diff options
author | Rasmus Villemoes <rasmus.villemoes@prevas.dk> | 2023-10-16 10:35:21 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-10-24 17:05:24 -0400 |
commit | 1000e2f96b582a69366f61a71d747c8ee9eb1cab (patch) | |
tree | ac1cff92f78425c14e665cd03e43aee9e3045b2f | |
parent | 2ba0f824ce0fa47a0ec7e22751d1759a5a28a32f (diff) | |
download | u-boot-1000e2f96b582a69366f61a71d747c8ee9eb1cab.zip u-boot-1000e2f96b582a69366f61a71d747c8ee9eb1cab.tar.gz u-boot-1000e2f96b582a69366f61a71d747c8ee9eb1cab.tar.bz2 |
serial: serial-uclass.c: move definition of _serial_flush up a bit
Preparation for next patch.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
-rw-r--r-- | drivers/serial/serial-uclass.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 4a2da7a..8bdcdd1 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -182,6 +182,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); @@ -235,18 +247,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); |