Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ff1443c authored by Russell King's avatar Russell King
Browse files

ARM: simplify early machine init hooks



Rather than storing each machine init hook separately, store a
pointer to the machine description record and dereference this
instead.  This pointer is only available while the init sections
are present, which is not a problem as we only use it from init
code.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent cd544ce7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -45,6 +45,11 @@ struct machine_desc {
#endif
};

/*
 * Current machine - only accessible during boot.
 */
extern struct machine_desc *machine_desc;

/*
 * Set of macros to define architecture features.  This is built into
 * a table by the linker.
+0 −2
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@ struct seq_file;
/*
 * This is internal.  Do not use it.
 */
extern unsigned int arch_nr_irqs;
extern void (*init_arch_irq)(void);
extern void init_FIQ(void);
extern int show_fiq_list(struct seq_file *, void *);

+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ struct sys_timer {
#endif
};

extern struct sys_timer *system_timer;
extern void timer_tick(void);

#endif
+3 −4
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include <linux/proc_fs.h>

#include <asm/system.h>
#include <asm/mach/arch.h>
#include <asm/mach/irq.h>
#include <asm/mach/time.h>

@@ -47,8 +48,6 @@
#define irq_finish(irq) do { } while (0)
#endif

unsigned int arch_nr_irqs;
void (*init_arch_irq)(void) __initdata = NULL;
unsigned long irq_err_count;

int show_interrupts(struct seq_file *p, void *v)
@@ -154,13 +153,13 @@ void set_irq_flags(unsigned int irq, unsigned int iflags)

void __init init_IRQ(void)
{
	init_arch_irq();
	machine_desc->init_irq();
}

#ifdef CONFIG_SPARSE_IRQ
int __init arch_probe_nr_irqs(void)
{
	nr_irqs = arch_nr_irqs ? arch_nr_irqs : NR_IRQS;
	nr_irqs = machine_desc->nr_irqs ? machine_desc->nr_irqs : NR_IRQS;
	return nr_irqs;
}
#endif
+4 −11
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ EXPORT_SYMBOL(elf_platform);
static const char *cpu_name;
static const char *machine_name;
static char __initdata cmd_line[COMMAND_LINE_SIZE];
struct machine_desc *machine_desc __initdata;

static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
@@ -708,13 +709,11 @@ static struct init_tags {
	{ 0, ATAG_NONE }
};

static void (*init_machine)(void) __initdata;

static int __init customize_machine(void)
{
	/* customizes platform devices, or adds new ones */
	if (init_machine)
		init_machine();
	if (machine_desc->init_machine)
		machine_desc->init_machine();
	return 0;
}
arch_initcall(customize_machine);
@@ -809,6 +808,7 @@ void __init setup_arch(char **cmdline_p)

	setup_processor();
	mdesc = setup_machine(machine_arch_type);
	machine_desc = mdesc;
	machine_name = mdesc->name;

	if (mdesc->soft_reboot)
@@ -868,13 +868,6 @@ void __init setup_arch(char **cmdline_p)
	cpu_init();
	tcm_init();

	/*
	 * Set up various architecture-specific pointers
	 */
	arch_nr_irqs = mdesc->nr_irqs;
	init_arch_irq = mdesc->init_irq;
	system_timer = mdesc->timer;
	init_machine = mdesc->init_machine;
#ifdef CONFIG_MULTI_IRQ_HANDLER
	handle_arch_irq = mdesc->handle_irq;
#endif
Loading