diff options
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/dw_wdt.c | 6 | ||||
-rw-r--r-- | drivers/watchdog/iTCO_wdt.c | 35 | ||||
-rw-r--r-- | drivers/watchdog/imx2_wdt.c | 11 | ||||
-rw-r--r-- | drivers/watchdog/nuc900_wdt.c | 5 | ||||
-rw-r--r-- | drivers/watchdog/omap_wdt.c | 2 | ||||
-rw-r--r-- | drivers/watchdog/pnx4008_wdt.c | 2 | ||||
-rw-r--r-- | drivers/watchdog/stmp3xxx_wdt.c | 2 | ||||
-rw-r--r-- | drivers/watchdog/via_wdt.c | 6 | ||||
-rw-r--r-- | drivers/watchdog/wafer5823wdt.c | 4 | ||||
-rw-r--r-- | drivers/watchdog/wm8350_wdt.c | 4 |
10 files changed, 51 insertions, 26 deletions
diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c index 1b0e3dd81c1a..63d7b58f1c7d 100644 --- a/drivers/watchdog/dw_wdt.c +++ b/drivers/watchdog/dw_wdt.c | |||
@@ -300,11 +300,7 @@ static int __devinit dw_wdt_drv_probe(struct platform_device *pdev) | |||
300 | if (!mem) | 300 | if (!mem) |
301 | return -EINVAL; | 301 | return -EINVAL; |
302 | 302 | ||
303 | if (!devm_request_mem_region(&pdev->dev, mem->start, resource_size(mem), | 303 | dw_wdt.regs = devm_request_and_ioremap(&pdev->dev, mem); |
304 | "dw_wdt")) | ||
305 | return -ENOMEM; | ||
306 | |||
307 | dw_wdt.regs = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); | ||
308 | if (!dw_wdt.regs) | 304 | if (!dw_wdt.regs) |
309 | return -ENOMEM; | 305 | return -ENOMEM; |
310 | 306 | ||
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index 99796c5d913d..bdf401b240b5 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c | |||
@@ -36,6 +36,7 @@ | |||
36 | * document number TBD : Patsburg (PBG) | 36 | * document number TBD : Patsburg (PBG) |
37 | * document number TBD : DH89xxCC | 37 | * document number TBD : DH89xxCC |
38 | * document number TBD : Panther Point | 38 | * document number TBD : Panther Point |
39 | * document number TBD : Lynx Point | ||
39 | */ | 40 | */ |
40 | 41 | ||
41 | /* | 42 | /* |
@@ -126,6 +127,7 @@ enum iTCO_chipsets { | |||
126 | TCO_PBG, /* Patsburg */ | 127 | TCO_PBG, /* Patsburg */ |
127 | TCO_DH89XXCC, /* DH89xxCC */ | 128 | TCO_DH89XXCC, /* DH89xxCC */ |
128 | TCO_PPT, /* Panther Point */ | 129 | TCO_PPT, /* Panther Point */ |
130 | TCO_LPT, /* Lynx Point */ | ||
129 | }; | 131 | }; |
130 | 132 | ||
131 | static struct { | 133 | static struct { |
@@ -189,6 +191,7 @@ static struct { | |||
189 | {"Patsburg", 2}, | 191 | {"Patsburg", 2}, |
190 | {"DH89xxCC", 2}, | 192 | {"DH89xxCC", 2}, |
191 | {"Panther Point", 2}, | 193 | {"Panther Point", 2}, |
194 | {"Lynx Point", 2}, | ||
192 | {NULL, 0} | 195 | {NULL, 0} |
193 | }; | 196 | }; |
194 | 197 | ||
@@ -331,6 +334,38 @@ static DEFINE_PCI_DEVICE_TABLE(iTCO_wdt_pci_tbl) = { | |||
331 | { PCI_VDEVICE(INTEL, 0x1e5d), TCO_PPT}, | 334 | { PCI_VDEVICE(INTEL, 0x1e5d), TCO_PPT}, |
332 | { PCI_VDEVICE(INTEL, 0x1e5e), TCO_PPT}, | 335 | { PCI_VDEVICE(INTEL, 0x1e5e), TCO_PPT}, |
333 | { PCI_VDEVICE(INTEL, 0x1e5f), TCO_PPT}, | 336 | { PCI_VDEVICE(INTEL, 0x1e5f), TCO_PPT}, |
337 | { PCI_VDEVICE(INTEL, 0x8c40), TCO_LPT}, | ||
338 | { PCI_VDEVICE(INTEL, 0x8c41), TCO_LPT}, | ||
339 | { PCI_VDEVICE(INTEL, 0x8c42), TCO_LPT}, | ||
340 | { PCI_VDEVICE(INTEL, 0x8c43), TCO_LPT}, | ||
341 | { PCI_VDEVICE(INTEL, 0x8c44), TCO_LPT}, | ||
342 | { PCI_VDEVICE(INTEL, 0x8c45), TCO_LPT}, | ||
343 | { PCI_VDEVICE(INTEL, 0x8c46), TCO_LPT}, | ||
344 | { PCI_VDEVICE(INTEL, 0x8c47), TCO_LPT}, | ||
345 | { PCI_VDEVICE(INTEL, 0x8c48), TCO_LPT}, | ||
346 | { PCI_VDEVICE(INTEL, 0x8c49), TCO_LPT}, | ||
347 | { PCI_VDEVICE(INTEL, 0x8c4a), TCO_LPT}, | ||
348 | { PCI_VDEVICE(INTEL, 0x8c4b), TCO_LPT}, | ||
349 | { PCI_VDEVICE(INTEL, 0x8c4c), TCO_LPT}, | ||
350 | { PCI_VDEVICE(INTEL, 0x8c4d), TCO_LPT}, | ||
351 | { PCI_VDEVICE(INTEL, 0x8c4e), TCO_LPT}, | ||
352 | { PCI_VDEVICE(INTEL, 0x8c4f), TCO_LPT}, | ||
353 | { PCI_VDEVICE(INTEL, 0x8c50), TCO_LPT}, | ||
354 | { PCI_VDEVICE(INTEL, 0x8c51), TCO_LPT}, | ||
355 | { PCI_VDEVICE(INTEL, 0x8c52), TCO_LPT}, | ||
356 | { PCI_VDEVICE(INTEL, 0x8c53), TCO_LPT}, | ||
357 | { PCI_VDEVICE(INTEL, 0x8c54), TCO_LPT}, | ||
358 | { PCI_VDEVICE(INTEL, 0x8c55), TCO_LPT}, | ||
359 | { PCI_VDEVICE(INTEL, 0x8c56), TCO_LPT}, | ||
360 | { PCI_VDEVICE(INTEL, 0x8c57), TCO_LPT}, | ||
361 | { PCI_VDEVICE(INTEL, 0x8c58), TCO_LPT}, | ||
362 | { PCI_VDEVICE(INTEL, 0x8c59), TCO_LPT}, | ||
363 | { PCI_VDEVICE(INTEL, 0x8c5a), TCO_LPT}, | ||
364 | { PCI_VDEVICE(INTEL, 0x8c5b), TCO_LPT}, | ||
365 | { PCI_VDEVICE(INTEL, 0x8c5c), TCO_LPT}, | ||
366 | { PCI_VDEVICE(INTEL, 0x8c5d), TCO_LPT}, | ||
367 | { PCI_VDEVICE(INTEL, 0x8c5e), TCO_LPT}, | ||
368 | { PCI_VDEVICE(INTEL, 0x8c5f), TCO_LPT}, | ||
334 | { 0, }, /* End of list */ | 369 | { 0, }, /* End of list */ |
335 | }; | 370 | }; |
336 | MODULE_DEVICE_TABLE(pci, iTCO_wdt_pci_tbl); | 371 | MODULE_DEVICE_TABLE(pci, iTCO_wdt_pci_tbl); |
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index b8ef2c6dca7c..c44c3334003a 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c | |||
@@ -247,7 +247,6 @@ static struct miscdevice imx2_wdt_miscdev = { | |||
247 | static int __init imx2_wdt_probe(struct platform_device *pdev) | 247 | static int __init imx2_wdt_probe(struct platform_device *pdev) |
248 | { | 248 | { |
249 | int ret; | 249 | int ret; |
250 | int res_size; | ||
251 | struct resource *res; | 250 | struct resource *res; |
252 | 251 | ||
253 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 252 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -256,15 +255,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev) | |||
256 | return -ENODEV; | 255 | return -ENODEV; |
257 | } | 256 | } |
258 | 257 | ||
259 | res_size = resource_size(res); | 258 | imx2_wdt.base = devm_request_and_ioremap(&pdev->dev, res); |
260 | if (!devm_request_mem_region(&pdev->dev, res->start, res_size, | ||
261 | res->name)) { | ||
262 | dev_err(&pdev->dev, "can't allocate %d bytes at %d address\n", | ||
263 | res_size, res->start); | ||
264 | return -ENOMEM; | ||
265 | } | ||
266 | |||
267 | imx2_wdt.base = devm_ioremap_nocache(&pdev->dev, res->start, res_size); | ||
268 | if (!imx2_wdt.base) { | 259 | if (!imx2_wdt.base) { |
269 | dev_err(&pdev->dev, "ioremap failed\n"); | 260 | dev_err(&pdev->dev, "ioremap failed\n"); |
270 | return -ENOMEM; | 261 | return -ENOMEM; |
diff --git a/drivers/watchdog/nuc900_wdt.c b/drivers/watchdog/nuc900_wdt.c index 50359bad9177..529085b8b8fb 100644 --- a/drivers/watchdog/nuc900_wdt.c +++ b/drivers/watchdog/nuc900_wdt.c | |||
@@ -72,7 +72,7 @@ struct nuc900_wdt { | |||
72 | }; | 72 | }; |
73 | 73 | ||
74 | static unsigned long nuc900wdt_busy; | 74 | static unsigned long nuc900wdt_busy; |
75 | struct nuc900_wdt *nuc900_wdt; | 75 | static struct nuc900_wdt *nuc900_wdt; |
76 | 76 | ||
77 | static inline void nuc900_wdt_keepalive(void) | 77 | static inline void nuc900_wdt_keepalive(void) |
78 | { | 78 | { |
@@ -287,7 +287,8 @@ static int __devinit nuc900wdt_probe(struct platform_device *pdev) | |||
287 | 287 | ||
288 | setup_timer(&nuc900_wdt->timer, nuc900_wdt_timer_ping, 0); | 288 | setup_timer(&nuc900_wdt->timer, nuc900_wdt_timer_ping, 0); |
289 | 289 | ||
290 | if (misc_register(&nuc900wdt_miscdev)) { | 290 | ret = misc_register(&nuc900wdt_miscdev); |
291 | if (ret) { | ||
291 | dev_err(&pdev->dev, "err register miscdev on minor=%d (%d)\n", | 292 | dev_err(&pdev->dev, "err register miscdev on minor=%d (%d)\n", |
292 | WATCHDOG_MINOR, ret); | 293 | WATCHDOG_MINOR, ret); |
293 | goto err_clk; | 294 | goto err_clk; |
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 4b33e3fd726b..d19ff5145e82 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c | |||
@@ -339,6 +339,7 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev) | |||
339 | return 0; | 339 | return 0; |
340 | 340 | ||
341 | err_misc: | 341 | err_misc: |
342 | pm_runtime_disable(wdev->dev); | ||
342 | platform_set_drvdata(pdev, NULL); | 343 | platform_set_drvdata(pdev, NULL); |
343 | iounmap(wdev->base); | 344 | iounmap(wdev->base); |
344 | 345 | ||
@@ -371,6 +372,7 @@ static int __devexit omap_wdt_remove(struct platform_device *pdev) | |||
371 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); | 372 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); |
372 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 373 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
373 | 374 | ||
375 | pm_runtime_disable(wdev->dev); | ||
374 | if (!res) | 376 | if (!res) |
375 | return -ENOENT; | 377 | return -ENOENT; |
376 | 378 | ||
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index bd143c9dd3e6..8e210aafdfd0 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c | |||
@@ -226,7 +226,7 @@ static long pnx4008_wdt_ioctl(struct file *file, unsigned int cmd, | |||
226 | static int pnx4008_wdt_release(struct inode *inode, struct file *file) | 226 | static int pnx4008_wdt_release(struct inode *inode, struct file *file) |
227 | { | 227 | { |
228 | if (!test_bit(WDT_OK_TO_CLOSE, &wdt_status)) | 228 | if (!test_bit(WDT_OK_TO_CLOSE, &wdt_status)) |
229 | printk(KERN_WARNING "WATCHDOG: Device closed unexpectdly\n"); | 229 | printk(KERN_WARNING "WATCHDOG: Device closed unexpectedly\n"); |
230 | 230 | ||
231 | wdt_disable(); | 231 | wdt_disable(); |
232 | clk_disable(wdt_clk); | 232 | clk_disable(wdt_clk); |
diff --git a/drivers/watchdog/stmp3xxx_wdt.c b/drivers/watchdog/stmp3xxx_wdt.c index 4c2a4e8698f9..e37d81178b9e 100644 --- a/drivers/watchdog/stmp3xxx_wdt.c +++ b/drivers/watchdog/stmp3xxx_wdt.c | |||
@@ -174,7 +174,7 @@ static int stmp3xxx_wdt_release(struct inode *inode, struct file *file) | |||
174 | if (!nowayout) { | 174 | if (!nowayout) { |
175 | if (!test_bit(WDT_OK_TO_CLOSE, &wdt_status)) { | 175 | if (!test_bit(WDT_OK_TO_CLOSE, &wdt_status)) { |
176 | wdt_ping(); | 176 | wdt_ping(); |
177 | pr_debug("%s: Device closed unexpectdly\n", __func__); | 177 | pr_debug("%s: Device closed unexpectedly\n", __func__); |
178 | ret = -EINVAL; | 178 | ret = -EINVAL; |
179 | } else { | 179 | } else { |
180 | wdt_disable(); | 180 | wdt_disable(); |
diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c index 026b4bbfa0aa..8f07dd4bd94a 100644 --- a/drivers/watchdog/via_wdt.c +++ b/drivers/watchdog/via_wdt.c | |||
@@ -124,8 +124,6 @@ static int wdt_stop(struct watchdog_device *wdd) | |||
124 | static int wdt_set_timeout(struct watchdog_device *wdd, | 124 | static int wdt_set_timeout(struct watchdog_device *wdd, |
125 | unsigned int new_timeout) | 125 | unsigned int new_timeout) |
126 | { | 126 | { |
127 | if (new_timeout < 1 || new_timeout > WDT_TIMEOUT_MAX) | ||
128 | return -EINVAL; | ||
129 | writel(new_timeout, wdt_mem + VIA_WDT_COUNT); | 127 | writel(new_timeout, wdt_mem + VIA_WDT_COUNT); |
130 | timeout = new_timeout; | 128 | timeout = new_timeout; |
131 | return 0; | 129 | return 0; |
@@ -150,6 +148,8 @@ static const struct watchdog_ops wdt_ops = { | |||
150 | static struct watchdog_device wdt_dev = { | 148 | static struct watchdog_device wdt_dev = { |
151 | .info = &wdt_info, | 149 | .info = &wdt_info, |
152 | .ops = &wdt_ops, | 150 | .ops = &wdt_ops, |
151 | .min_timeout = 1, | ||
152 | .max_timeout = WDT_TIMEOUT_MAX, | ||
153 | }; | 153 | }; |
154 | 154 | ||
155 | static int __devinit wdt_probe(struct pci_dev *pdev, | 155 | static int __devinit wdt_probe(struct pci_dev *pdev, |
@@ -233,7 +233,7 @@ static void __devexit wdt_remove(struct pci_dev *pdev) | |||
233 | pci_disable_device(pdev); | 233 | pci_disable_device(pdev); |
234 | } | 234 | } |
235 | 235 | ||
236 | DEFINE_PCI_DEVICE_TABLE(wdt_pci_table) = { | 236 | static DEFINE_PCI_DEVICE_TABLE(wdt_pci_table) = { |
237 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_CX700) }, | 237 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_CX700) }, |
238 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VX800) }, | 238 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VX800) }, |
239 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VX855) }, | 239 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VX855) }, |
diff --git a/drivers/watchdog/wafer5823wdt.c b/drivers/watchdog/wafer5823wdt.c index 42e940c23891..c3c3188c34d7 100644 --- a/drivers/watchdog/wafer5823wdt.c +++ b/drivers/watchdog/wafer5823wdt.c | |||
@@ -152,12 +152,12 @@ static long wafwdt_ioctl(struct file *file, unsigned int cmd, | |||
152 | return -EFAULT; | 152 | return -EFAULT; |
153 | 153 | ||
154 | if (options & WDIOS_DISABLECARD) { | 154 | if (options & WDIOS_DISABLECARD) { |
155 | wafwdt_start(); | 155 | wafwdt_stop(); |
156 | retval = 0; | 156 | retval = 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | if (options & WDIOS_ENABLECARD) { | 159 | if (options & WDIOS_ENABLECARD) { |
160 | wafwdt_stop(); | 160 | wafwdt_start(); |
161 | retval = 0; | 161 | retval = 0; |
162 | } | 162 | } |
163 | 163 | ||
diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c index 909c78650d3e..5d7113c7e501 100644 --- a/drivers/watchdog/wm8350_wdt.c +++ b/drivers/watchdog/wm8350_wdt.c | |||
@@ -212,10 +212,10 @@ static long wm8350_wdt_ioctl(struct file *file, unsigned int cmd, | |||
212 | 212 | ||
213 | /* Setting both simultaneously means at least one must fail */ | 213 | /* Setting both simultaneously means at least one must fail */ |
214 | if (options == WDIOS_DISABLECARD) | 214 | if (options == WDIOS_DISABLECARD) |
215 | ret = wm8350_wdt_start(wm8350); | 215 | ret = wm8350_wdt_stop(wm8350); |
216 | 216 | ||
217 | if (options == WDIOS_ENABLECARD) | 217 | if (options == WDIOS_ENABLECARD) |
218 | ret = wm8350_wdt_stop(wm8350); | 218 | ret = wm8350_wdt_start(wm8350); |
219 | break; | 219 | break; |
220 | } | 220 | } |
221 | 221 | ||