Skip to content

Commit f7be4e7

Browse files
aakoskinJohn Crispin
authored andcommitted
MIPS: early_printk: drop __init annotations
We cannot use __init for earlyprintk code or data, since the kernel parameter "keep_bootcon" allows leaving the boot console enabled. Currently MIPS will crash/hang/die if you use keep_bootcon. The patch fixes it at least on Lemote FuLoong mini-PC. Changes for other boards were done based on what I could find with grep... Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Patchwork: http://patchwork.linux-mips.org/patch/4935/ Signed-off-by: John Crispin <blogic@openwrt.org>
1 parent 1e7decd commit f7be4e7

5 files changed

Lines changed: 10 additions & 11 deletions

File tree

‎arch/mips/bcm63xx/early_printk.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <bcm63xx_io.h>
1111
#include <bcm63xx_regs.h>
1212

13-
static void __init wait_xfered(void)
13+
static void wait_xfered(void)
1414
{
1515
unsigned int val;
1616

@@ -22,7 +22,7 @@ static void __init wait_xfered(void)
2222
} while (1);
2323
}
2424

25-
void __init prom_putchar(char c)
25+
void prom_putchar(char c)
2626
{
2727
wait_xfered();
2828
bcm_uart0_writel(c, UART_FIFO_REG);

‎arch/mips/kernel/early_printk.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
extern void prom_putchar(char);
1616

17-
static void __init
18-
early_console_write(struct console *con, const char *s, unsigned n)
17+
static void early_console_write(struct console *con, const char *s, unsigned n)
1918
{
2019
while (n-- && *s) {
2120
if (*s == '\n')
@@ -25,7 +24,7 @@ early_console_write(struct console *con, const char *s, unsigned n)
2524
}
2625
}
2726

28-
static struct console early_console __initdata = {
27+
static struct console early_console = {
2928
.name = "early",
3029
.write = early_console_write,
3130
.flags = CON_PRINTBUFFER | CON_BOOT,

‎arch/mips/loongson1/common/prom.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void __init prom_free_prom_memory(void)
7373

7474
#define PORT(offset) (u8 *)(KSEG1ADDR(LS1X_UART0_BASE + offset))
7575

76-
void __init prom_putchar(char c)
76+
void prom_putchar(char c)
7777
{
7878
int timeout;
7979

‎arch/mips/sgi-ip27/ip27-console.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static inline struct ioc3_uartregs *console_uart(void)
3131
return &ioc3->sregs.uarta;
3232
}
3333

34-
void __init prom_putchar(char c)
34+
void prom_putchar(char c)
3535
{
3636
struct ioc3_uartregs *uart = console_uart();
3737

‎arch/mips/txx9/generic/setup.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,19 +513,19 @@ void __init txx9_sio_init(unsigned long baseaddr, int irq,
513513
}
514514

515515
#ifdef CONFIG_EARLY_PRINTK
516-
static void __init null_prom_putchar(char c)
516+
static void null_prom_putchar(char c)
517517
{
518518
}
519-
void (*txx9_prom_putchar)(char c) __initdata = null_prom_putchar;
519+
void (*txx9_prom_putchar)(char c) = null_prom_putchar;
520520

521-
void __init prom_putchar(char c)
521+
void prom_putchar(char c)
522522
{
523523
txx9_prom_putchar(c);
524524
}
525525

526526
static void __iomem *early_txx9_sio_port;
527527

528-
static void __init early_txx9_sio_putchar(char c)
528+
static void early_txx9_sio_putchar(char c)
529529
{
530530
#define TXX9_SICISR 0x0c
531531
#define TXX9_SITFIFO 0x1c

0 commit comments

Comments
 (0)