mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] watchdog: dw_wdt: do not register restart handler
@ 2024-05-27  9:50 Sascha Hauer
  2024-05-27  9:50 ` [PATCH 2/2] watchdog: fix watchdog restart handler when autoping is enabled Sascha Hauer
  2024-05-28  8:58 ` [PATCH 1/2] watchdog: dw_wdt: do not register restart handler Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2024-05-27  9:50 UTC (permalink / raw)
  To: Barebox List

The designware watchdog driver doesn't have a special reset function,
instead it only uses the regular watchdog to reset the SoC. Since
0ed7bb09f2ef7b ("watchdog: add option to provide fall-back restart handler")
the watchdog core provides the same functionality, so just drop the
restart functionality from the driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/watchdog/dw_wdt.c | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
index 178e0a29f1..398bbfe05f 100644
--- a/drivers/watchdog/dw_wdt.c
+++ b/drivers/watchdog/dw_wdt.c
@@ -16,7 +16,6 @@
 #include <init.h>
 #include <io.h>
 #include <of.h>
-#include <restart.h>
 #include <watchdog.h>
 #include <linux/clk.h>
 #include <linux/err.h>
@@ -37,7 +36,6 @@
 
 struct dw_wdt {
 	void __iomem		*regs;
-	struct restart_handler	restart;
 	struct watchdog		wdd;
 	struct reset_control	*rst;
 	unsigned int		rate;
@@ -115,19 +113,6 @@ static int dw_wdt_set_timeout(struct watchdog *wdd, unsigned int top_s)
 	return 0;
 }
 
-static void __noreturn dw_wdt_restart_handle(struct restart_handler *rst)
-{
-	struct dw_wdt *dw_wdt;
-
-	dw_wdt = container_of(rst, struct dw_wdt, restart);
-
-	dw_wdt->wdd.set_timeout(&dw_wdt->wdd, -1);
-
-	mdelay(1000);
-
-	hang();
-}
-
 static int dw_wdt_drv_probe(struct device *dev)
 {
 	struct watchdog *wdd;
@@ -173,13 +158,6 @@ static int dw_wdt_drv_probe(struct device *dev)
 	if (ret)
 		goto out_disable_clk;
 
-	dw_wdt->restart.name = "dw_wdt";
-	dw_wdt->restart.restart = dw_wdt_restart_handle;
-
-	ret = restart_handler_register(&dw_wdt->restart);
-	if (ret)
-		dev_warn(dev, "cannot register restart handler\n");
-
 	if (dw_wdt->rst)
 		reset_control_deassert(dw_wdt->rst);
 	else
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-28  8:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-27  9:50 [PATCH 1/2] watchdog: dw_wdt: do not register restart handler Sascha Hauer
2024-05-27  9:50 ` [PATCH 2/2] watchdog: fix watchdog restart handler when autoping is enabled Sascha Hauer
2024-05-28  8:58 ` [PATCH 1/2] watchdog: dw_wdt: do not register restart handler Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox