diff mbox series

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

Message ID 20210119223412.223492-5-tmaimon77@gmail.com
State New
Headers show
Series Minor NPCM7xx modifications to dev-5.8 | expand

Commit Message

Tomer Maimon Jan. 19, 2021, 10:34 p.m. UTC
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@gmail.com>
---
 drivers/watchdog/npcm_wdt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

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) {