[PATCH 1/3] watchdog: imxwd: Add error messages for some failure points in .probe()

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Mon Jun 27 03:33:56 PDT 2022


Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
 drivers/watchdog/imxwd.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index 31ea388c2cf2..3e596b55f8f7 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -245,12 +245,16 @@ static int imx_wd_probe(struct device_d *dev)
 	}
 
 	clk = clk_get(dev, NULL);
-	if (IS_ERR(clk))
+	if (IS_ERR(clk)) {
+		dev_err(dev, "Failed to get clk: %d\n", PTR_ERR(clk));
 		return PTR_ERR(clk);
+	}
 
 	ret = clk_enable(clk);
-	if (ret)
+	if (ret) {
+		dev_err(dev, "Failed to enable clk: %d\n", ret);
 		return ret;
+	}
 
 	priv->base = IOMEM(iores->start);
 	priv->ops = ops;
@@ -272,14 +276,16 @@ static int imx_wd_probe(struct device_d *dev)
 		}
 
 		ret = watchdog_register(&priv->wd);
-		if (ret)
+		if (ret) {
+			dev_err(dev, "Failed to register watchdog device: %d\n", ret);
 			goto on_error;
+		}
 	}
 
 	if (priv->ops->init) {
 		ret = priv->ops->init(priv);
 		if (ret) {
-			dev_err(dev, "Failed to init watchdog device %d\n", ret);
+			dev_err(dev, "Failed to init watchdog device: %d\n", ret);
 			goto error_unregister;
 		}
 	}

base-commit: 512d036587a38c57a30cc63ce48c19c895b9d729
-- 
2.36.1




More information about the barebox mailing list