From 29ada739c0cb549acf2a6eb5aa6d10412a32951a Mon Sep 17 00:00:00 2001 From: Wim Van Sebroeck Date: Thu, 22 Mar 2012 20:42:16 +0100 Subject: [PATCH] --- yaml --- r: 296799 b: refs/heads/master c: dddbc6a0513b25c80e73e14ee704186deedc0d00 h: refs/heads/master i: 296797: 96501d68d0ac7c4dadf6159d37461af23c606ed4 296795: 842e278ed8ab8d8684f7132301045dec03d4d5af 296791: 7d17f3e77df668f170982c33a63c5c625f1735c8 296783: f7d2b9203ea6048046a65d787303205897ae7201 296767: 15b08bea8464090cbc70e60fd0c3c77e7d4e0aeb v: v3 --- [refs] | 2 +- trunk/drivers/watchdog/coh901327_wdt.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 10a6a13fc60c..e1f4c8dc5cd0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 15b25701b282bd761a82c6508529b2145744075f +refs/heads/master: dddbc6a0513b25c80e73e14ee704186deedc0d00 diff --git a/trunk/drivers/watchdog/coh901327_wdt.c b/trunk/drivers/watchdog/coh901327_wdt.c index 7f0cbeb58770..6876430a9f5e 100644 --- a/trunk/drivers/watchdog/coh901327_wdt.c +++ b/trunk/drivers/watchdog/coh901327_wdt.c @@ -67,7 +67,7 @@ #define U300_WDOG_IFR_WILL_BARK_IRQ_FORCE_ENABLE 0x0001U /* Default timeout in seconds = 1 minute */ -static int margin = 60; +static unsigned int margin = 60; static resource_size_t phybase; static resource_size_t physize; static int irq; @@ -153,7 +153,7 @@ static void coh901327_disable(void) static int coh901327_start(struct watchdog_device *wdt_dev) { - coh901327_enable(margin * 100); + coh901327_enable(wdt_dev->timeout * 100); return 0; } @@ -176,10 +176,10 @@ static int coh901327_ping(struct watchdog_device *wdd) static int coh901327_settimeout(struct watchdog_device *wdt_dev, unsigned int time) { - margin = time; + wdt_dev->timeout = time; clk_enable(clk); /* Set new timeout value */ - writew(margin * 100, virtbase + U300_WDOG_TR); + writew(time * 100, virtbase + U300_WDOG_TR); /* Feed the dog */ writew(U300_WDOG_FR_FEED_RESTART_TIMER, virtbase + U300_WDOG_FR); @@ -250,7 +250,7 @@ static struct watchdog_device coh901327_wdt = { .info = &coh901327_ident, .ops = &coh901327_ops, /* - * Max margin is 327 since the 10ms + * Max timeout is 327 since the 10ms * timeout register is max * 0x7FFF = 327670ms ~= 327s. */ @@ -353,6 +353,10 @@ 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_register_device(&coh901327_wdt); if (ret == 0) dev_info(&pdev->dev, @@ -461,7 +465,7 @@ module_exit(coh901327_exit); MODULE_AUTHOR("Linus Walleij "); MODULE_DESCRIPTION("COH 901 327 Watchdog"); -module_param(margin, int, 0); +module_param(margin, uint, 0); MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)"); MODULE_LICENSE("GPL");