mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 4/7] reset-source: Use globalvar_add_simple_enum
Date: Wed, 26 Aug 2015 13:17:13 +0200	[thread overview]
Message-ID: <1440587836-22105-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1440587836-22105-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@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


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

  parent reply	other threads:[~2015-08-26 11:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 11:17 Allow multiple restart/watchdog/reset-source handlers Sascha Hauer
2015-08-26 11:17 ` [PATCH 1/7] restart: replace reset_cpu with registered restart handlers Sascha Hauer
2015-08-26 11:17 ` [PATCH 2/7] watchdog: Allow multiple watchdogs Sascha Hauer
2015-08-26 11:17 ` [PATCH 3/7] watchdog: Give watchdogs a name Sascha Hauer
2015-08-26 11:17 ` Sascha Hauer [this message]
2015-08-26 11:17 ` [PATCH 5/7] reset-source: Allow different priorities Sascha Hauer
2015-08-26 11:17 ` [PATCH 6/7] mfd: da9063: add da9063 watchdog and system restart driver Sascha Hauer
2015-08-26 11:17 ` [PATCH 7/7] mfd: da9053: add da9053 " Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440587836-22105-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox