]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
watchdog: fix set_timeout operations
authorWim Van Sebroeck <wim@iguana.be>
Wed, 29 Feb 2012 19:20:58 +0000 (20:20 +0100)
committerWim Van Sebroeck <wim@iguana.be>
Tue, 27 Mar 2012 18:08:09 +0000 (20:08 +0200)
Since we changed the behaviour of the set_timeout operation in the
watchdog API, we need to change the allready converted drivers so
that they update the timeout field at the end of the set_timeout
operation.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/staging/mei/wd.c
drivers/watchdog/jz4740_wdt.c
drivers/watchdog/pnx4008_wdt.c
drivers/watchdog/s3c2410_wdt.c
drivers/watchdog/via_wdt.c
drivers/watchdog/wm831x_wdt.c
drivers/watchdog/wm8350_wdt.c

index a6910da78a64232af3d88872310074af1f8645b1..cf4c29d10e7f588cbb404afa2daa06aaf7757f13 100644 (file)
@@ -323,6 +323,7 @@ static int mei_wd_ops_set_timeout(struct watchdog_device *wd_dev, unsigned int t
        mutex_lock(&dev->device_lock);
 
        dev->wd_timeout = timeout;
+       wd_dev->timeout = timeout;
        mei_wd_set_start_timeout(dev, dev->wd_timeout);
 
        mutex_unlock(&dev->device_lock);
index 28af416c3fbf34eae07d4e9951cf10a6e78ca75c..978615ef899d5e52dfb403dd583762fa5cd5fbae 100644 (file)
@@ -109,6 +109,7 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
 
        writeb(0x1, drvdata->base + JZ_REG_WDT_COUNTER_ENABLE);
 
+       wdt_dev->timeout = new_timeout;
        return 0;
 }
 
index 3d9bb89776a76c82941ca692da0e70348cb77ffb..6b8432f61d05d922b0279530426429fa9d687cd8 100644 (file)
@@ -121,6 +121,7 @@ static int pnx4008_wdt_stop(struct watchdog_device *wdd)
 static int pnx4008_wdt_set_timeout(struct watchdog_device *wdd,
                                    unsigned int new_timeout)
 {
+       wdd->timeout = new_timeout;
        return 0;
 }
 
index 96b598c52dac8502bb09bfd518a6607546bcb446..46c251d1893dd239bfb416bd5ee5e63aa3b96a70 100644 (file)
@@ -201,6 +201,8 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned timeou
        writel(count, wdt_base + S3C2410_WTDAT);
        writel(wtcon, wdt_base + S3C2410_WTCON);
 
+       wdd->timeout = timeout;
+
        return 0;
 }
 
index ef83f0242411939c53f5c085be4e7c73e4e396d4..465e08273c972c3df5ca01bcf9a44487520cc0bc 100644 (file)
@@ -101,7 +101,7 @@ static void wdt_timer_tick(unsigned long data)
 static int wdt_ping(struct watchdog_device *wdd)
 {
        /* calculate when the next userspace timeout will be */
-       next_heartbeat = jiffies + timeout * HZ;
+       next_heartbeat = jiffies + wdd->timeout * HZ;
        return 0;
 }
 
@@ -109,7 +109,7 @@ static int wdt_start(struct watchdog_device *wdd)
 {
        unsigned int ctl = readl(wdt_mem);
 
-       writel(timeout, wdt_mem + VIA_WDT_COUNT);
+       writel(wdd->timeout, wdt_mem + VIA_WDT_COUNT);
        writel(ctl | VIA_WDT_RUNNING | VIA_WDT_TRIGGER, wdt_mem);
        wdt_ping(wdd);
        mod_timer(&timer, jiffies + WDT_HEARTBEAT);
@@ -128,7 +128,7 @@ static int wdt_set_timeout(struct watchdog_device *wdd,
                           unsigned int new_timeout)
 {
        writel(new_timeout, wdt_mem + VIA_WDT_COUNT);
-       timeout = new_timeout;
+       wdd->timeout = new_timeout;
        return 0;
 }
 
index b3e8a62f27a991728bf1e9a79111a9c986a55072..b1815c5ed7a72ac7c24e90e8dc62649f8a32bd0b 100644 (file)
@@ -163,6 +163,8 @@ static int wm831x_wdt_set_timeout(struct watchdog_device *wdt_dev,
                        ret);
        }
 
+       wdt_dev->timeout = timeout;
+
        return ret;
 }
 
index 0ce572c1565905fbb790c1413b542c8dfffce857..3c76693447fd5483ba01934e619afe74320f1e86 100644 (file)
@@ -60,6 +60,7 @@ static int wm8350_wdt_set_timeout(struct watchdog_device *wdt_dev,
        wm8350_reg_lock(wm8350);
        mutex_unlock(&wdt_mutex);
 
+       wdt_dev->timeout = timeout;
        return ret;
 }