aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2011-02-21 01:00:32 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-02-23 11:13:17 -0500
commitdce72dd08c976c9e5e1367bf994b306b15ae87fe (patch)
tree3713d0935cf6d5c9c3a642ef9b851fd41b4f4dd8 /arch/arm/kernel/setup.c
parent3a6b1676c6f27f7fad1a3d6fab5a95f90b1e7402 (diff)
ARM: 6749/1: fold lookup_machine_type() into setup_machine()
Since commit 6fc31d54 there is no callers for lookup_machine_type() other than setup_machine(). And if the former fails it won't return, therefore the error path in the later is dead code. Let's clean things up by merging them together. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r--arch/arm/kernel/setup.c48
1 files changed, 17 insertions, 31 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 056bf1878f8a..6ce80106316e 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -325,28 +325,6 @@ static void __init early_print(const char *str, ...)
325 printk("%s", buf); 325 printk("%s", buf);
326} 326}
327 327
328static struct machine_desc * __init lookup_machine_type(unsigned int type)
329{
330 extern struct machine_desc __arch_info_begin[], __arch_info_end[];
331 struct machine_desc *p;
332
333 for (p = __arch_info_begin; p < __arch_info_end; p++)
334 if (type == p->nr)
335 return p;
336
337 early_print("\n"
338 "Error: unrecognized/unsupported machine ID (r1 = 0x%08x).\n\n"
339 "Available machine support:\n\nID (hex)\tNAME\n", type);
340
341 for (p = __arch_info_begin; p < __arch_info_end; p++)
342 early_print("%08x\t%s\n", p->nr, p->name);
343
344 early_print("\nPlease check your kernel config and/or bootloader.\n");
345
346 while (true)
347 /* can't use cpu_relax() here as it may require MMU setup */;
348}
349
350static void __init feat_v6_fixup(void) 328static void __init feat_v6_fixup(void)
351{ 329{
352 int id = read_cpuid_id(); 330 int id = read_cpuid_id();
@@ -463,21 +441,29 @@ void cpu_init(void)
463 441
464static struct machine_desc * __init setup_machine(unsigned int nr) 442static struct machine_desc * __init setup_machine(unsigned int nr)
465{ 443{
466 struct machine_desc *list; 444 extern struct machine_desc __arch_info_begin[], __arch_info_end[];
445 struct machine_desc *p;
467 446
468 /* 447 /*
469 * locate machine in the list of supported machines. 448 * locate machine in the list of supported machines.
470 */ 449 */
471 list = lookup_machine_type(nr); 450 for (p = __arch_info_begin; p < __arch_info_end; p++)
472 if (!list) { 451 if (nr == p->nr) {
473 printk("Machine configuration botched (nr %d), unable " 452 printk("Machine: %s\n", p->name);
474 "to continue.\n", nr); 453 return p;
475 while (1); 454 }
476 }
477 455
478 printk("Machine: %s\n", list->name); 456 early_print("\n"
457 "Error: unrecognized/unsupported machine ID (r1 = 0x%08x).\n\n"
458 "Available machine support:\n\nID (hex)\tNAME\n", nr);
459
460 for (p = __arch_info_begin; p < __arch_info_end; p++)
461 early_print("%08x\t%s\n", p->nr, p->name);
479 462
480 return list; 463 early_print("\nPlease check your kernel config and/or bootloader.\n");
464
465 while (true)
466 /* can't use cpu_relax() here as it may require MMU setup */;
481} 467}
482 468
483static int __init arm_add_memory(unsigned long start, unsigned long size) 469static int __init arm_add_memory(unsigned long start, unsigned long size)