[PATCH 4/7] reset-source: Use globalvar_add_simple_enum

Sascha Hauer s.hauer at pengutronix.de
Wed Aug 26 04:17:13 PDT 2015


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/reset_source.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/common/reset_source.c b/common/reset_source.c
index 80002a9..f9ee99b 100644
--- a/common/reset_source.c
+++ b/common/reset_source.c
@@ -40,15 +40,13 @@ EXPORT_SYMBOL(reset_source_get);
 void reset_source_set(enum reset_src_type st)
 {
 	reset_source = st;
-
-	globalvar_add_simple("system.reset", reset_src_names[reset_source]);
 }
 EXPORT_SYMBOL(reset_source_set);
 
-/* ensure this runs after the 'global' device is already registerd */
 static int reset_source_init(void)
 {
-	reset_source_set(reset_source);
+	globalvar_add_simple_enum("system.reset", (unsigned int *)&reset_source,
+			reset_src_names, ARRAY_SIZE(reset_src_names));
 
 	return 0;
 }
-- 
2.5.0




More information about the barebox mailing list