Merge branch 'for-3.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
[firefly-linux-kernel-4.4.55.git] / drivers / watchdog / s3c2410_wdt.c
index 04e5a6de47d72743b7010758f1c78230d416f221..200ece5e2a22adb0d18279af33a83f2458d3ece4 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
 #include <linux/err.h>
+#include <linux/of.h>
 
 #include <mach/map.h>
 
@@ -201,7 +202,7 @@ 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;
+       wdd->timeout = (count * divisor) / freq;
 
        return 0;
 }
@@ -503,8 +504,6 @@ static const struct of_device_id s3c2410_wdt_match[] = {
        {},
 };
 MODULE_DEVICE_TABLE(of, s3c2410_wdt_match);
-#else
-#define s3c2410_wdt_match NULL
 #endif
 
 static struct platform_driver s3c2410wdt_driver = {
@@ -516,7 +515,7 @@ static struct platform_driver s3c2410wdt_driver = {
        .driver         = {
                .owner  = THIS_MODULE,
                .name   = "s3c2410-wdt",
-               .of_match_table = s3c2410_wdt_match,
+               .of_match_table = of_match_ptr(s3c2410_wdt_match),
        },
 };