diff options
author | Ezequiel Garcia <ezequiel.garcia@imgtec.com> | 2015-05-11 13:41:04 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2015-06-22 09:54:15 -0400 |
commit | deb8d50eb40085d304b42a524d4ba326fcecc73d (patch) | |
tree | f16187fb084ef9ee960297dd67c18b5ebcecfac1 | |
parent | c631f20068369a8b901574df9c7bfc57ce13de75 (diff) |
watchdog: imgpdc: Fix max timeout
Maximum timeout is currently set in clock cycles, but the watchdog
core expects it to be in seconds. Fix it.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r-- | drivers/watchdog/imgpdc_wdt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/watchdog/imgpdc_wdt.c b/drivers/watchdog/imgpdc_wdt.c index 28c10e292aa3..56b8ebcc3775 100644 --- a/drivers/watchdog/imgpdc_wdt.c +++ b/drivers/watchdog/imgpdc_wdt.c | |||
@@ -152,6 +152,7 @@ static int pdc_wdt_restart(struct notifier_block *this, unsigned long mode, | |||
152 | 152 | ||
153 | static int pdc_wdt_probe(struct platform_device *pdev) | 153 | static int pdc_wdt_probe(struct platform_device *pdev) |
154 | { | 154 | { |
155 | u64 div; | ||
155 | int ret, val; | 156 | int ret, val; |
156 | unsigned long clk_rate; | 157 | unsigned long clk_rate; |
157 | struct resource *res; | 158 | struct resource *res; |
@@ -211,7 +212,10 @@ static int pdc_wdt_probe(struct platform_device *pdev) | |||
211 | 212 | ||
212 | pdc_wdt->wdt_dev.info = &pdc_wdt_info; | 213 | pdc_wdt->wdt_dev.info = &pdc_wdt_info; |
213 | pdc_wdt->wdt_dev.ops = &pdc_wdt_ops; | 214 | pdc_wdt->wdt_dev.ops = &pdc_wdt_ops; |
214 | pdc_wdt->wdt_dev.max_timeout = 1 << PDC_WDT_CONFIG_DELAY_MASK; | 215 | |
216 | div = 1ULL << (PDC_WDT_CONFIG_DELAY_MASK + 1); | ||
217 | do_div(div, clk_rate); | ||
218 | pdc_wdt->wdt_dev.max_timeout = div; | ||
215 | pdc_wdt->wdt_dev.timeout = PDC_WDT_DEF_TIMEOUT; | 219 | pdc_wdt->wdt_dev.timeout = PDC_WDT_DEF_TIMEOUT; |
216 | pdc_wdt->wdt_dev.parent = &pdev->dev; | 220 | pdc_wdt->wdt_dev.parent = &pdev->dev; |
217 | watchdog_set_drvdata(&pdc_wdt->wdt_dev, pdc_wdt); | 221 | watchdog_set_drvdata(&pdc_wdt->wdt_dev, pdc_wdt); |