[PATCH 5/5] startup: Print error message when initcall fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There was a time when we used to panic when initcalls failed. Then
it was changed to totally ignore the return value. Instead, print
an error message now so that the user can get a clue when something
bad happened. So initcalls are now recommended to actually return
negative error codes when something fails.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 common/startup.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/startup.c b/common/startup.c
index b53bbef..775f97c 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -100,7 +100,9 @@ void start_barebox (void)
 			initcall < __barebox_initcalls_end; initcall++) {
 		debug("initcall-> %pS\n", *initcall);
 		result = (*initcall)();
-		debug("initcall<- %pS (%d)\n", *initcall, result);
+		if (result)
+			pr_err("initcall %pS failed: %s\n", *initcall,
+					strerror(-result));
 	}
 
 	debug("initcalls done\n");
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux