mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/2] watchdog: dw_wdt: do not register restart handler
Date: Mon, 27 May 2024 11:50:56 +0200	[thread overview]
Message-ID: <20240527095057.3418435-1-s.hauer@pengutronix.de> (raw)

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




             reply	other threads:[~2024-05-27  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27  9:50 Sascha Hauer [this message]
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

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=20240527095057.3418435-1-s.hauer@pengutronix.de \
    --to=s.hauer@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