watchdog: Add 'action' and 'data' parameters to restart handler callback
authorGuenter Roeck <linux@roeck-us.net>
Sat, 27 Feb 2016 01:32:49 +0000 (17:32 -0800)
committerWim Van Sebroeck <wim@iguana.be>
Tue, 1 Mar 2016 14:36:35 +0000 (15:36 +0100)
The 'action' (or restart mode) and data parameters may be used by restart
handlers, so they should be passed to the restart callback functions.

Cc: Sylvain Lemieux <slemieux@tycoint.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
14 files changed:
drivers/watchdog/bcm47xx_wdt.c
drivers/watchdog/da9063_wdt.c
drivers/watchdog/digicolor_wdt.c
drivers/watchdog/imgpdc_wdt.c
drivers/watchdog/imx2_wdt.c
drivers/watchdog/lpc18xx_wdt.c
drivers/watchdog/meson_wdt.c
drivers/watchdog/moxart_wdt.c
drivers/watchdog/mtk_wdt.c
drivers/watchdog/qcom-wdt.c
drivers/watchdog/s3c2410_wdt.c
drivers/watchdog/sunxi_wdt.c
drivers/watchdog/watchdog_core.c
include/linux/watchdog.h

index df1c2a4..a1900b9 100644 (file)
@@ -87,7 +87,8 @@ static int bcm47xx_wdt_hard_set_timeout(struct watchdog_device *wdd,
        return 0;
 }
 
-static int bcm47xx_wdt_restart(struct watchdog_device *wdd)
+static int bcm47xx_wdt_restart(struct watchdog_device *wdd,
+                              unsigned long action, void *data)
 {
        struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd);
 
index 11e8875..a100f64 100644 (file)
@@ -119,7 +119,8 @@ static int da9063_wdt_set_timeout(struct watchdog_device *wdd,
        return ret;
 }
 
-static int da9063_wdt_restart(struct watchdog_device *wdd)
+static int da9063_wdt_restart(struct watchdog_device *wdd, unsigned long action,
+                             void *data)
 {
        struct da9063_watchdog *wdt = watchdog_get_drvdata(wdd);
        int ret;
index 1ccb0b2..77df772 100644 (file)
@@ -48,7 +48,8 @@ static void dc_wdt_set(struct dc_wdt *wdt, u32 ticks)
        spin_unlock_irqrestore(&wdt->lock, flags);
 }
 
-static int dc_wdt_restart(struct watchdog_device *wdog)
+static int dc_wdt_restart(struct watchdog_device *wdog, unsigned long action,
+                         void *data)
 {
        struct dc_wdt *wdt = watchdog_get_drvdata(wdog);
 
index 3679f2e..516fbef 100644 (file)
@@ -150,7 +150,8 @@ static int pdc_wdt_start(struct watchdog_device *wdt_dev)
        return 0;
 }
 
-static int pdc_wdt_restart(struct watchdog_device *wdt_dev)
+static int pdc_wdt_restart(struct watchdog_device *wdt_dev,
+                          unsigned long action, void *data)
 {
        struct pdc_wdt_dev *wdt = watchdog_get_drvdata(wdt_dev);
 
index e47966a..4cb59a2 100644 (file)
@@ -80,7 +80,8 @@ static const struct watchdog_info imx2_wdt_info = {
        .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
 };
 
-static int imx2_wdt_restart(struct watchdog_device *wdog)
+static int imx2_wdt_restart(struct watchdog_device *wdog, unsigned long action,
+                           void *data)
 {
        struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
        unsigned int wcr_enable = IMX2_WDT_WCR_WDE;
index 6914c83..fd171e6 100644 (file)
@@ -153,7 +153,8 @@ static int lpc18xx_wdt_start(struct watchdog_device *wdt_dev)
        return 0;
 }
 
-static int lpc18xx_wdt_restart(struct watchdog_device *wdt_dev)
+static int lpc18xx_wdt_restart(struct watchdog_device *wdt_dev,
+                              unsigned long action, void *data)
 {
        struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev);
        unsigned long flags;
index aea5d2f..56ea1ca 100644 (file)
@@ -62,7 +62,8 @@ struct meson_wdt_dev {
        const struct meson_wdt_data *data;
 };
 
-static int meson_wdt_restart(struct watchdog_device *wdt_dev)
+static int meson_wdt_restart(struct watchdog_device *wdt_dev,
+                            unsigned long action, void *data)
 {
        struct meson_wdt_dev *meson_wdt = watchdog_get_drvdata(wdt_dev);
        u32 tc_reboot = MESON_WDT_DC_RESET;
index 885c81b..2c4a73d 100644 (file)
@@ -31,7 +31,8 @@ struct moxart_wdt_dev {
 
 static int heartbeat;
 
-static int moxart_wdt_restart(struct watchdog_device *wdt_dev)
+static int moxart_wdt_restart(struct watchdog_device *wdt_dev,
+                             unsigned long action, void *data)
 {
        struct moxart_wdt_dev *moxart_wdt = watchdog_get_drvdata(wdt_dev);
 
index b78776c..7ed417a 100644 (file)
@@ -64,7 +64,8 @@ struct mtk_wdt_dev {
        void __iomem *wdt_base;
 };
 
-static int mtk_wdt_restart(struct watchdog_device *wdt_dev)
+static int mtk_wdt_restart(struct watchdog_device *wdt_dev,
+                          unsigned long action, void *data)
 {
        struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdt_dev);
        void __iomem *wdt_base;
index 424f9a9..20563cc 100644 (file)
@@ -70,7 +70,8 @@ static int qcom_wdt_set_timeout(struct watchdog_device *wdd,
        return qcom_wdt_start(wdd);
 }
 
-static int qcom_wdt_restart(struct watchdog_device *wdd)
+static int qcom_wdt_restart(struct watchdog_device *wdd, unsigned long action,
+                           void *data)
 {
        struct qcom_wdt *wdt = to_qcom_wdt(wdd);
        u32 timeout;
index 0093450..d57f19b 100644 (file)
@@ -349,7 +349,8 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned timeou
        return 0;
 }
 
-static int s3c2410wdt_restart(struct watchdog_device *wdd)
+static int s3c2410wdt_restart(struct watchdog_device *wdd, unsigned long action,
+                             void *data)
 {
        struct s3c2410_wdt *wdt = watchdog_get_drvdata(wdd);
        void __iomem *wdt_base = wdt->reg_base;
index e027deb..953bb7b 100644 (file)
@@ -83,7 +83,8 @@ static const int wdt_timeout_map[] = {
 };
 
 
-static int sunxi_wdt_restart(struct watchdog_device *wdt_dev)
+static int sunxi_wdt_restart(struct watchdog_device *wdt_dev,
+                            unsigned long action, void *data)
 {
        struct sunxi_wdt_dev *sunxi_wdt = watchdog_get_drvdata(wdt_dev);
        void __iomem *wdt_base = sunxi_wdt->wdt_base;
index e600fd9..d9b3c9c 100644 (file)
@@ -164,7 +164,7 @@ static int watchdog_restart_notifier(struct notifier_block *nb,
 
        int ret;
 
-       ret = wdd->ops->restart(wdd);
+       ret = wdd->ops->restart(wdd, action, data);
        if (ret)
                return NOTIFY_BAD;
 
index b585fa2..0b565f2 100644 (file)
@@ -46,7 +46,7 @@ struct watchdog_ops {
        unsigned int (*status)(struct watchdog_device *);
        int (*set_timeout)(struct watchdog_device *, unsigned int);
        unsigned int (*get_timeleft)(struct watchdog_device *);
-       int (*restart)(struct watchdog_device *);
+       int (*restart)(struct watchdog_device *, unsigned long, void *);
        long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long);
 };