Skip to content

Commit

Permalink
serial: 8250_early: Remove __init marking from early write
Browse files Browse the repository at this point in the history
The earlycon would be alive outside the init code in these cases:
1/ we have keep_bootcon in cmdline.
2/ we don't have a real console to switch to.

So remove the __init marking to avoid invalid memory access.

Signed-off-by: Jeffy Chen <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Tested-by: Brian Norris <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
JeffyCN authored and gregkh committed Jul 30, 2017
1 parent 1b7eec2 commit bdc4704
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/tty/serial/8250/8250_early.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <asm/io.h>
#include <asm/serial.h>

static unsigned int __init serial8250_early_in(struct uart_port *port, int offset)
static unsigned int serial8250_early_in(struct uart_port *port, int offset)
{
int reg_offset = offset;
offset <<= port->regshift;
Expand All @@ -60,7 +60,7 @@ static unsigned int __init serial8250_early_in(struct uart_port *port, int offse
}
}

static void __init serial8250_early_out(struct uart_port *port, int offset, int value)
static void serial8250_early_out(struct uart_port *port, int offset, int value)
{
int reg_offset = offset;
offset <<= port->regshift;
Expand Down Expand Up @@ -89,7 +89,7 @@ static void __init serial8250_early_out(struct uart_port *port, int offset, int

#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)

static void __init serial_putc(struct uart_port *port, int c)
static void serial_putc(struct uart_port *port, int c)
{
unsigned int status;

Expand All @@ -103,7 +103,7 @@ static void __init serial_putc(struct uart_port *port, int c)
}
}

static void __init early_serial8250_write(struct console *console,
static void early_serial8250_write(struct console *console,
const char *s, unsigned int count)
{
struct earlycon_device *device = console->data;
Expand Down

0 comments on commit bdc4704

Please sign in to comment.