mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/4] reset_source: migrate from reset_source_name to reset_source_xlate
Date: Mon, 10 Feb 2020 14:09:51 +0100	[thread overview]
Message-ID: <20200210130952.19779-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20200210130952.19779-1-a.fatoum@pengutronix.de>

Whether reset_source_name() returns the just set reset_source is
dependent on probe order and the priorities of prior reset sources
in relation to the current one. Make this more robust by using the new
reset_source_xlate.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-imx/imx.c        | 2 +-
 drivers/watchdog/stm32_iwdg.c  | 2 +-
 drivers/watchdog/stpmic1_wdt.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/imx.c b/arch/arm/mach-imx/imx.c
index 0942d5069562..9f91cab781fb 100644
--- a/arch/arm/mach-imx/imx.c
+++ b/arch/arm/mach-imx/imx.c
@@ -202,5 +202,5 @@ void imx_set_reset_reason(void __iomem *srsr,
 	reset_source_set_prinst(type, RESET_SOURCE_DEFAULT_PRIORITY, instance);
 
 	pr_info("i.MX reset reason %s (SRSR: 0x%08x)\n",
-		reset_source_name(), reg);
+		reset_source_xlate(type), reg);
 }
diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
index c7a5cb9caaf4..8a28bfd8a06a 100644
--- a/drivers/watchdog/stm32_iwdg.c
+++ b/drivers/watchdog/stm32_iwdg.c
@@ -185,7 +185,7 @@ static int stm32_set_reset_reason(struct regmap *rcc)
 	reset_source_set_prinst(type, RESET_SOURCE_DEFAULT_PRIORITY, instance);
 
 	pr_info("STM32 RCC reset reason %s (MP_RSTSR: 0x%08x)\n",
-		reset_source_name(), reg);
+		reset_source_xlate(type), reg);
 
 	return 0;
 }
diff --git a/drivers/watchdog/stpmic1_wdt.c b/drivers/watchdog/stpmic1_wdt.c
index 40273ffc4c85..9d7f9361a159 100644
--- a/drivers/watchdog/stpmic1_wdt.c
+++ b/drivers/watchdog/stpmic1_wdt.c
@@ -152,7 +152,7 @@ static int stpmic1_set_reset_reason(struct regmap *map)
 	reset_source_set_prinst(type, 400, instance);
 
 	pr_info("STPMIC1 reset reason %s (RREQ_STATE_SR: 0x%08x)\n",
-		reset_source_name(), reg);
+		reset_source_xlate(type), reg);
 
 	return 0;
 }
-- 
2.25.0


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

  parent reply	other threads:[~2020-02-10 13:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 13:09 [PATCH 1/4] reset_source: introduce reset_source_xlate to translate specific type Ahmad Fatoum
2020-02-10 13:09 ` [PATCH 2/4] watchdog: f71808e: only print reset reason if one's indicated Ahmad Fatoum
2020-02-10 13:09 ` Ahmad Fatoum [this message]
2020-02-10 13:09 ` [PATCH 4/4] reset: stm32: migrate restart reason and handler from stm32_iwdg Ahmad Fatoum
2020-02-19  8:24 ` [PATCH 1/4] reset_source: introduce reset_source_xlate to translate specific type 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=20200210130952.19779-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@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