aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-04-19 06:56:36 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-05-31 05:25:52 -0400
commitc83c199199b9d68c56b5cc53b01b8f513f91b93a (patch)
treed2e940cafde78d71db17a0544683f114c77e12e2 /drivers/watchdog
parentc023b8b295ff71df223746e6d9fd0e56cfe72846 (diff)
watchdog: coh901327: devicetree support
This adds support for probing the COH 901 327 watchdog from the device tree and also adds associated bindings. Acked-by: Wim Van Sebroeck <wim@iguana.be> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/coh901327_wdt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c
index b9b8a8be6f12..4bd070f524e5 100644
--- a/drivers/watchdog/coh901327_wdt.c
+++ b/drivers/watchdog/coh901327_wdt.c
@@ -354,9 +354,9 @@ static int __init coh901327_probe(struct platform_device *pdev)
354 354
355 clk_disable(clk); 355 clk_disable(clk);
356 356
357 if (margin < 1 || margin > 327) 357 ret = watchdog_init_timeout(&coh901327_wdt, margin, &pdev->dev);
358 margin = 60; 358 if (ret < 0)
359 coh901327_wdt.timeout = margin; 359 coh901327_wdt.timeout = 60;
360 360
361 ret = watchdog_register_device(&coh901327_wdt); 361 ret = watchdog_register_device(&coh901327_wdt);
362 if (ret == 0) 362 if (ret == 0)
@@ -441,10 +441,16 @@ void coh901327_watchdog_reset(void)
441 /* Return and await doom */ 441 /* Return and await doom */
442} 442}
443 443
444static const struct of_device_id coh901327_dt_match[] = {
445 { .compatible = "stericsson,coh901327" },
446 {},
447};
448
444static struct platform_driver coh901327_driver = { 449static struct platform_driver coh901327_driver = {
445 .driver = { 450 .driver = {
446 .owner = THIS_MODULE, 451 .owner = THIS_MODULE,
447 .name = "coh901327_wdog", 452 .name = "coh901327_wdog",
453 .of_match_table = coh901327_dt_match,
448 }, 454 },
449 .remove = __exit_p(coh901327_remove), 455 .remove = __exit_p(coh901327_remove),
450 .suspend = coh901327_suspend, 456 .suspend = coh901327_suspend,