[PATCH 4/4] exitcall: move board_shutdown to exitcall infrastructure

Herve Codina Herve.CODINA at celad.com
Mon Jul 6 00:36:46 PDT 2015


Signed-off-by: Herve Codina <Herve.CODINA at celad.com>
---
 arch/arm/boards/animeo_ip/init.c |    2 +-
 common/startup.c                 |    5 -----
 include/common.h                 |    1 -
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/arm/boards/animeo_ip/init.c b/arch/arm/boards/animeo_ip/init.c
index 0fda013..2069ab3 100644
--- a/arch/arm/boards/animeo_ip/init.c
+++ b/arch/arm/boards/animeo_ip/init.c
@@ -346,6 +346,7 @@ static void animeo_ip_shutdown(void)
 	animeo_ip_shutdown_uart(IOMEM(AT91SAM9260_BASE_US0));
 	animeo_ip_shutdown_uart(IOMEM(AT91SAM9260_BASE_US1));
 }
+postdevshutdown_exitcall(animeo_ip_shutdown);
 
 static int animeo_ip_console_init(void)
 {
@@ -353,7 +354,6 @@ static int animeo_ip_console_init(void)
 
 	usart0 = at91_register_uart(1, ATMEL_UART_RTS);
 	usart1 = at91_register_uart(2, ATMEL_UART_RTS);
-	board_shutdown = animeo_ip_shutdown;
 
 	barebox_set_model("Somfy Animeo IP");
 	barebox_set_hostname("animeoip");
diff --git a/common/startup.c b/common/startup.c
index 4ed390c..dc12415 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -135,8 +135,6 @@ void __noreturn hang (void)
 	for (;;);
 }
 
-void (*board_shutdown)(void);
-
 /* Everything needed to cleanly shutdown barebox.
  * Should be called before starting an OS to get
  * the devices into a clean state
@@ -150,7 +148,4 @@ void shutdown_barebox(void)
 		pr_debug("exitcall-> %pS\n", *exitcall);
 		(*exitcall)();
 	}
-	
-	if (board_shutdown)
-		board_shutdown();
 }
diff --git a/include/common.h b/include/common.h
index 6766c02..6b9dd4d 100644
--- a/include/common.h
+++ b/include/common.h
@@ -116,7 +116,6 @@ extern int (*barebox_main)(void);
 
 void __noreturn start_barebox(void);
 void shutdown_barebox(void);
-extern void (*board_shutdown)(void);
 
 /*
  * architectures which have special calling conventions for
-- 
1.7.9.5




More information about the barebox mailing list