On 02/03/2022 11:19, Woody Lin wrote: > The 'kgdboc_earlycon_init' looks for boot console that has both .read > and .write callbacks. Adds 'samsung_early_read' to samsung_tty.c's early > console to support kgdboc. > > Signed-off-by: Woody Lin <woodylin@xxxxxxxxxx> > --- > drivers/tty/serial/samsung_tty.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c > index d002a4e48ed9..eeb30d016ff1 100644 > --- a/drivers/tty/serial/samsung_tty.c > +++ b/drivers/tty/serial/samsung_tty.c > @@ -2949,6 +2949,7 @@ static void wr_reg_barrier(struct uart_port *port, u32 reg, u32 val) > > struct samsung_early_console_data { > u32 txfull_mask; > + u32 rxfifo_mask; > }; > > static void samsung_early_busyuart(struct uart_port *port) > @@ -2983,6 +2984,26 @@ static void samsung_early_write(struct console *con, const char *s, > uart_console_write(&dev->port, s, n, samsung_early_putc); > } > > +static int samsung_early_read(struct console *con, char *s, unsigned int n) > +{ > + struct earlycon_device *dev = con->data; > + struct samsung_early_console_data *data = dev->port.private_data; This can be const. Rest looks ok. Best regards, Krzysztof