aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init/main.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/init/main.c b/init/main.c
index 2714e0e7cfec..a596cb8ac982 100644
--- a/init/main.c
+++ b/init/main.c
@@ -571,17 +571,23 @@ static void __init do_initcalls(void)
571 int count = preempt_count(); 571 int count = preempt_count();
572 572
573 for (call = __initcall_start; call < __initcall_end; call++) { 573 for (call = __initcall_start; call < __initcall_end; call++) {
574 char *msg; 574 char *msg = NULL;
575 char msgbuf[40];
576 int result;
575 577
576 if (initcall_debug) { 578 if (initcall_debug) {
577 printk(KERN_DEBUG "Calling initcall 0x%p", *call); 579 printk("Calling initcall 0x%p", *call);
578 print_fn_descriptor_symbol(": %s()", (unsigned long) *call); 580 print_fn_descriptor_symbol(": %s()",
581 (unsigned long) *call);
579 printk("\n"); 582 printk("\n");
580 } 583 }
581 584
582 (*call)(); 585 result = (*call)();
583 586
584 msg = NULL; 587 if (result && (result != -ENODEV || initcall_debug)) {
588 sprintf(msgbuf, "error code %d", result);
589 msg = msgbuf;
590 }
585 if (preempt_count() != count) { 591 if (preempt_count() != count) {
586 msg = "preemption imbalance"; 592 msg = "preemption imbalance";
587 preempt_count() = count; 593 preempt_count() = count;
@@ -591,8 +597,10 @@ static void __init do_initcalls(void)
591 local_irq_enable(); 597 local_irq_enable();
592 } 598 }
593 if (msg) { 599 if (msg) {
594 printk(KERN_WARNING "error in initcall at 0x%p: " 600 printk(KERN_WARNING "initcall at 0x%p", *call);
595 "returned with %s\n", *call, msg); 601 print_fn_descriptor_symbol(": %s()",
602 (unsigned long) *call);
603 printk(": returned with %s\n", msg);
596 } 604 }
597 } 605 }
598 606