diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2013-04-19 12:56:36 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-05-31 11:25:52 +0200 |
commit | c83c199199b9d68c56b5cc53b01b8f513f91b93a (patch) | |
tree | d2e940cafde78d71db17a0544683f114c77e12e2 /drivers/watchdog | |
parent | c023b8b295ff71df223746e6d9fd0e56cfe72846 (diff) | |
download | linux-stable-c83c199199b9d68c56b5cc53b01b8f513f91b93a.tar.gz linux-stable-c83c199199b9d68c56b5cc53b01b8f513f91b93a.tar.bz2 linux-stable-c83c199199b9d68c56b5cc53b01b8f513f91b93a.zip |
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.c | 12 |
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) clk_disable(clk); - if (margin < 1 || margin > 327) - margin = 60; - coh901327_wdt.timeout = margin; + ret = watchdog_init_timeout(&coh901327_wdt, margin, &pdev->dev); + if (ret < 0) + coh901327_wdt.timeout = 60; ret = watchdog_register_device(&coh901327_wdt); if (ret == 0) @@ -441,10 +441,16 @@ void coh901327_watchdog_reset(void) /* Return and await doom */ } +static const struct of_device_id coh901327_dt_match[] = { + { .compatible = "stericsson,coh901327" }, + {}, +}; + static struct platform_driver coh901327_driver = { .driver = { .owner = THIS_MODULE, .name = "coh901327_wdog", + .of_match_table = coh901327_dt_match, }, .remove = __exit_p(coh901327_remove), .suspend = coh901327_suspend, |