[PATCH linux dev-5.8 v1 4/4] watchdog: npcm: Modify get reset status function

Tomer Maimon tmaimon77 at gmail.com
Wed Jan 20 09:34:12 AEDT 2021


Once the syscon phandle not found the WD reset
status will not supported and return to the
function caller.

Signed-off-by: Tomer Maimon <tmaimon77 at gmail.com>
---
 drivers/watchdog/npcm_wdt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c
index a93180d0a6f4..f87cfadd8d9b 100644
--- a/drivers/watchdog/npcm_wdt.c
+++ b/drivers/watchdog/npcm_wdt.c
@@ -202,8 +202,10 @@ static void npcm_get_reset_status(struct npcm_wdt *wdt, struct device *dev)
 	u32 rstval;
 
 	gcr_regmap = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon");
-	if (IS_ERR(gcr_regmap))
+	if (IS_ERR(gcr_regmap)) {
 		dev_warn(dev, "Failed to find gcr syscon, WD reset status not supported\n");
+		return;
+	}
 
 	regmap_read(gcr_regmap, NPCM7XX_RESSR_OFFSET, &rstval);
 	if (!rstval) {
-- 
2.22.0



More information about the openbmc mailing list