Commit 1f761b3e authored by Florian Fainelli's avatar Florian Fainelli Committed by Thomas Bogendoerfer
Browse files

MIPS: Allow modules to set board_be_handler



After making the brcmstb_gisb driver modular with 707a4cdf ("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: default avatarGuenter Roeck <linux@roeck-us.net>
Suggested-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fixes: 707a4cdf ("bus: brcmstb_gisb: Allow building as module")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 36de23a4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -117,21 +117,21 @@ static void __init dec_be_init(void)
{
	switch (mips_machtype) {
	case MACH_DS23100:	/* DS2100/DS3100 Pmin/Pmax */
		board_be_handler = dec_kn01_be_handler;
		mips_set_be_handler(dec_kn01_be_handler);
		busirq_handler = dec_kn01_be_interrupt;
		busirq_flags |= IRQF_SHARED;
		dec_kn01_be_init();
		break;
	case MACH_DS5000_1XX:	/* DS5000/1xx 3min */
	case MACH_DS5000_XX:	/* DS5000/xx Maxine */
		board_be_handler = dec_kn02xa_be_handler;
		mips_set_be_handler(dec_kn02xa_be_handler);
		busirq_handler = dec_kn02xa_be_interrupt;
		dec_kn02xa_be_init();
		break;
	case MACH_DS5000_200:	/* DS5000/200 3max */
	case MACH_DS5000_2X0:	/* DS5000/240 3max+ */
	case MACH_DS5900:	/* DS5900 bigmax */
		board_be_handler = dec_ecc_be_handler;
		mips_set_be_handler(dec_ecc_be_handler);
		busirq_handler = dec_ecc_be_interrupt;
		dec_ecc_be_init();
		break;
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#define MIPS_BE_FATAL	2		/* treat as an unrecoverable error */

extern void (*board_be_init)(void);
extern int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
void mips_set_be_handler(int (*handler)(struct pt_regs *reg, int is_fixup));

extern void (*board_nmi_handler_setup)(void);
extern void (*board_ejtag_handler_setup)(void);
+7 −1
Original line number Diff line number Diff line
@@ -103,13 +103,19 @@ extern asmlinkage void handle_reserved(void);
extern void tlb_do_page_fault_0(void);

void (*board_be_init)(void);
int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
static int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
void (*board_nmi_handler_setup)(void);
void (*board_ejtag_handler_setup)(void);
void (*board_bind_eic_interrupt)(int irq, int regset);
void (*board_ebase_setup)(void);
void(*board_cache_error_setup)(void);

void mips_set_be_handler(int (*handler)(struct pt_regs *regs, int is_fixup))
{
	board_be_handler = handler;
}
EXPORT_SYMBOL_GPL(mips_set_be_handler);

static void show_raw_backtrace(unsigned long reg29, const char *loglvl,
			       bool user)
{
+1 −1
Original line number Diff line number Diff line
@@ -112,5 +112,5 @@ static int ip22_be_handler(struct pt_regs *regs, int is_fixup)

void __init ip22_be_init(void)
{
	board_be_handler = ip22_be_handler;
	mips_set_be_handler(ip22_be_handler);
}
+1 −1
Original line number Diff line number Diff line
@@ -468,7 +468,7 @@ static int ip28_be_handler(struct pt_regs *regs, int is_fixup)

void __init ip22_be_init(void)
{
	board_be_handler = ip28_be_handler;
	mips_set_be_handler(ip28_be_handler);
}

int ip28_show_be_info(struct seq_file *m)
Loading