Skip to content

Commit 1f761b3

Browse files
ffainellitsbogend
authored andcommitted
MIPS: Allow modules to set board_be_handler
After making the brcmstb_gisb driver modular with 707a4cd ("bus: brcmstb_gisb: Allow building as module") Guenter reported that mips allmodconfig failed to link because board_be_handler was referenced. Thomas indicated that if we were to continue making the brcmstb_gisb driver modular for MIPS we would need to introduce a function that allows setting the board_be_handler and export that function towards modules. This is what is being done here: board_be_handler is made static and is now settable with a mips_set_be_handler() function which is exported. Reported-by: Guenter Roeck <[email protected]> Suggested-by: Thomas Bogendoerfer <[email protected]> Fixes: 707a4cd ("bus: brcmstb_gisb: Allow building as module") Signed-off-by: Florian Fainelli <[email protected]> Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 36de23a commit 1f761b3

File tree

12 files changed

+20
-14
lines changed

12 files changed

+20
-14
lines changed

arch/mips/dec/setup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,21 @@ static void __init dec_be_init(void)
117117
{
118118
switch (mips_machtype) {
119119
case MACH_DS23100: /* DS2100/DS3100 Pmin/Pmax */
120-
board_be_handler = dec_kn01_be_handler;
120+
mips_set_be_handler(dec_kn01_be_handler);
121121
busirq_handler = dec_kn01_be_interrupt;
122122
busirq_flags |= IRQF_SHARED;
123123
dec_kn01_be_init();
124124
break;
125125
case MACH_DS5000_1XX: /* DS5000/1xx 3min */
126126
case MACH_DS5000_XX: /* DS5000/xx Maxine */
127-
board_be_handler = dec_kn02xa_be_handler;
127+
mips_set_be_handler(dec_kn02xa_be_handler);
128128
busirq_handler = dec_kn02xa_be_interrupt;
129129
dec_kn02xa_be_init();
130130
break;
131131
case MACH_DS5000_200: /* DS5000/200 3max */
132132
case MACH_DS5000_2X0: /* DS5000/240 3max+ */
133133
case MACH_DS5900: /* DS5900 bigmax */
134-
board_be_handler = dec_ecc_be_handler;
134+
mips_set_be_handler(dec_ecc_be_handler);
135135
busirq_handler = dec_ecc_be_interrupt;
136136
dec_ecc_be_init();
137137
break;

arch/mips/include/asm/traps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define MIPS_BE_FATAL 2 /* treat as an unrecoverable error */
1616

1717
extern void (*board_be_init)(void);
18-
extern int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
18+
void mips_set_be_handler(int (*handler)(struct pt_regs *reg, int is_fixup));
1919

2020
extern void (*board_nmi_handler_setup)(void);
2121
extern void (*board_ejtag_handler_setup)(void);

arch/mips/kernel/traps.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,19 @@ extern asmlinkage void handle_reserved(void);
103103
extern void tlb_do_page_fault_0(void);
104104

105105
void (*board_be_init)(void);
106-
int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
106+
static int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
107107
void (*board_nmi_handler_setup)(void);
108108
void (*board_ejtag_handler_setup)(void);
109109
void (*board_bind_eic_interrupt)(int irq, int regset);
110110
void (*board_ebase_setup)(void);
111111
void(*board_cache_error_setup)(void);
112112

113+
void mips_set_be_handler(int (*handler)(struct pt_regs *regs, int is_fixup))
114+
{
115+
board_be_handler = handler;
116+
}
117+
EXPORT_SYMBOL_GPL(mips_set_be_handler);
118+
113119
static void show_raw_backtrace(unsigned long reg29, const char *loglvl,
114120
bool user)
115121
{

arch/mips/sgi-ip22/ip22-berr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,5 @@ static int ip22_be_handler(struct pt_regs *regs, int is_fixup)
112112

113113
void __init ip22_be_init(void)
114114
{
115-
board_be_handler = ip22_be_handler;
115+
mips_set_be_handler(ip22_be_handler);
116116
}

arch/mips/sgi-ip22/ip28-berr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ static int ip28_be_handler(struct pt_regs *regs, int is_fixup)
468468

469469
void __init ip22_be_init(void)
470470
{
471-
board_be_handler = ip28_be_handler;
471+
mips_set_be_handler(ip28_be_handler);
472472
}
473473

474474
int ip28_show_be_info(struct seq_file *m)

arch/mips/sgi-ip27/ip27-berr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void __init ip27_be_init(void)
8585
int cpu = LOCAL_HUB_L(PI_CPU_NUM);
8686
int cpuoff = cpu << 8;
8787

88-
board_be_handler = ip27_be_handler;
88+
mips_set_be_handler(ip27_be_handler);
8989

9090
LOCAL_HUB_S(PI_ERR_INT_PEND,
9191
cpu ? PI_ERR_CLEAR_ALL_B : PI_ERR_CLEAR_ALL_A);

arch/mips/sgi-ip32/ip32-berr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ static int ip32_be_handler(struct pt_regs *regs, int is_fixup)
3434

3535
void __init ip32_be_init(void)
3636
{
37-
board_be_handler = ip32_be_handler;
37+
mips_set_be_handler(ip32_be_handler);
3838
}

arch/mips/sibyte/swarm/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void __init plat_mem_setup(void)
123123
#error invalid SiByte board configuration
124124
#endif
125125

126-
board_be_handler = swarm_be_handler;
126+
mips_set_be_handler(swarm_be_handler);
127127

128128
if (xicor_probe())
129129
swarm_rtc_type = RTC_XICOR;

arch/mips/txx9/generic/setup_tx4927.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static int tx4927_be_handler(struct pt_regs *regs, int is_fixup)
8080
}
8181
static void __init tx4927_be_init(void)
8282
{
83-
board_be_handler = tx4927_be_handler;
83+
mips_set_be_handler(tx4927_be_handler);
8484
}
8585

8686
static struct resource tx4927_sdram_resource[4];

arch/mips/txx9/generic/setup_tx4938.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static int tx4938_be_handler(struct pt_regs *regs, int is_fixup)
8282
}
8383
static void __init tx4938_be_init(void)
8484
{
85-
board_be_handler = tx4938_be_handler;
85+
mips_set_be_handler(tx4938_be_handler);
8686
}
8787

8888
static struct resource tx4938_sdram_resource[4];

0 commit comments

Comments
 (0)