diff mbox series

[U-Boot,v2,14/41] serial: usb: Correct the usbtty_...() prototypes

Message ID 20191108195348.110648-3-sjg@chromium.org
State Changes Requested
Delegated to: Tom Rini
Headers show
Series common: Further reduce common.h | expand

Commit Message

Simon Glass Nov. 8, 2019, 7:53 p.m. UTC
The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 drivers/serial/usbtty.c |  1 +
 include/serial.h        | 18 ++++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

Comments

Tom Rini Nov. 11, 2019, 2:19 p.m. UTC | #1
On Fri, Nov 08, 2019 at 12:53:21PM -0700, Simon Glass wrote:

> The function declarations in serial.h are not in sync with what is
> currently used in usbtty. Fix this by updating the header and including
> it, to help catch future such problems.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox series

Patch

diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index 76d9c8a3a6..f1c1a260da 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -11,6 +11,7 @@ 
 #include <config.h>
 #include <circbuf.h>
 #include <env.h>
+#include <serial.h>
 #include <stdio_dev.h>
 #include <asm/unaligned.h>
 #include "usbtty.h"
diff --git a/include/serial.h b/include/serial.h
index c1368c68b6..38a1cc99ae 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -50,18 +50,20 @@  extern void serial_reinit_all(void);
 /* For usbtty */
 #ifdef CONFIG_USB_TTY
 
-extern int usbtty_getc(void);
-extern void usbtty_putc(const char c);
-extern void usbtty_puts(const char *str);
-extern int usbtty_tstc(void);
+struct stdio_dev;
+
+int usbtty_getc(struct stdio_dev *dev);
+void usbtty_putc(struct stdio_dev *dev, const char c);
+void usbtty_puts(struct stdio_dev *dev, const char *str);
+int usbtty_tstc(struct stdio_dev *dev);
 
 #else
 
 /* stubs */
-#define usbtty_getc() 0
-#define usbtty_putc(a)
-#define usbtty_puts(a)
-#define usbtty_tstc() 0
+#define usbtty_getc(dev) 0
+#define usbtty_putc(dev, a)
+#define usbtty_puts(dev, a)
+#define usbtty_tstc(dev) 0
 
 #endif /* CONFIG_USB_TTY */