1 From 80969a68ffed12f82e2a29908306ff43a6861a61 Mon Sep 17 00:00:00 2001
2 From: Damien Riegel <damien.riegel@savoirfairelinux.com>
3 Date: Mon, 16 Nov 2015 12:28:09 -0500
4 Subject: watchdog: qcom-wdt: use core restart handler
6 Get rid of the custom restart handler by using the one provided by the
9 Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
10 Reviewed-by: Guenter Roeck <linux@roeck-us.net>
11 Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
12 Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
15 drivers/watchdog/qcom-wdt.c | 49 ++++++++++++++++++---------------------------
16 1 file changed, 19 insertions(+), 30 deletions(-)
18 --- a/drivers/watchdog/qcom-wdt.c
19 +++ b/drivers/watchdog/qcom-wdt.c
21 #include <linux/module.h>
23 #include <linux/platform_device.h>
24 -#include <linux/reboot.h>
25 #include <linux/watchdog.h>
28 @@ -28,7 +27,6 @@ struct qcom_wdt {
29 struct watchdog_device wdd;
32 - struct notifier_block restart_nb;
36 @@ -72,25 +70,9 @@ static int qcom_wdt_set_timeout(struct w
37 return qcom_wdt_start(wdd);
40 -static const struct watchdog_ops qcom_wdt_ops = {
41 - .start = qcom_wdt_start,
42 - .stop = qcom_wdt_stop,
43 - .ping = qcom_wdt_ping,
44 - .set_timeout = qcom_wdt_set_timeout,
45 - .owner = THIS_MODULE,
48 -static const struct watchdog_info qcom_wdt_info = {
49 - .options = WDIOF_KEEPALIVEPING
52 - .identity = KBUILD_MODNAME,
55 -static int qcom_wdt_restart(struct notifier_block *nb, unsigned long action,
57 +static int qcom_wdt_restart(struct watchdog_device *wdd)
59 - struct qcom_wdt *wdt = container_of(nb, struct qcom_wdt, restart_nb);
60 + struct qcom_wdt *wdt = to_qcom_wdt(wdd);
64 @@ -110,9 +92,25 @@ static int qcom_wdt_restart(struct notif
72 +static const struct watchdog_ops qcom_wdt_ops = {
73 + .start = qcom_wdt_start,
74 + .stop = qcom_wdt_stop,
75 + .ping = qcom_wdt_ping,
76 + .set_timeout = qcom_wdt_set_timeout,
77 + .restart = qcom_wdt_restart,
78 + .owner = THIS_MODULE,
81 +static const struct watchdog_info qcom_wdt_info = {
82 + .options = WDIOF_KEEPALIVEPING
85 + .identity = KBUILD_MODNAME,
88 static int qcom_wdt_probe(struct platform_device *pdev)
91 @@ -187,14 +185,6 @@ static int qcom_wdt_probe(struct platfor
92 goto err_clk_unprepare;
96 - * WDT restart notifier has priority 0 (use as a last resort)
98 - wdt->restart_nb.notifier_call = qcom_wdt_restart;
99 - ret = register_restart_handler(&wdt->restart_nb);
101 - dev_err(&pdev->dev, "failed to setup restart handler\n");
103 platform_set_drvdata(pdev, wdt);
106 @@ -207,7 +197,6 @@ static int qcom_wdt_remove(struct platfo
108 struct qcom_wdt *wdt = platform_get_drvdata(pdev);
110 - unregister_restart_handler(&wdt->restart_nb);
111 watchdog_unregister_device(&wdt->wdd);
112 clk_disable_unprepare(wdt->clk);