.. | .. |
---|
6 | 6 | * Watchdog driver for the ST-Ericsson AB COH 901 327 IP core |
---|
7 | 7 | * Author: Linus Walleij <linus.walleij@stericsson.com> |
---|
8 | 8 | */ |
---|
9 | | -#include <linux/module.h> |
---|
| 9 | +#include <linux/moduleparam.h> |
---|
10 | 10 | #include <linux/mod_devicetable.h> |
---|
11 | 11 | #include <linux/types.h> |
---|
12 | 12 | #include <linux/watchdog.h> |
---|
.. | .. |
---|
243 | 243 | .timeout = U300_WDOG_DEFAULT_TIMEOUT, |
---|
244 | 244 | }; |
---|
245 | 245 | |
---|
246 | | -static int __exit coh901327_remove(struct platform_device *pdev) |
---|
247 | | -{ |
---|
248 | | - watchdog_unregister_device(&coh901327_wdt); |
---|
249 | | - coh901327_disable(); |
---|
250 | | - free_irq(irq, pdev); |
---|
251 | | - clk_disable_unprepare(clk); |
---|
252 | | - clk_put(clk); |
---|
253 | | - return 0; |
---|
254 | | -} |
---|
255 | | - |
---|
256 | 246 | static int __init coh901327_probe(struct platform_device *pdev) |
---|
257 | 247 | { |
---|
258 | 248 | struct device *dev = &pdev->dev; |
---|
259 | 249 | int ret; |
---|
260 | 250 | u16 val; |
---|
261 | | - struct resource *res; |
---|
262 | 251 | |
---|
263 | 252 | parent = dev; |
---|
264 | 253 | |
---|
265 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
266 | | - virtbase = devm_ioremap_resource(dev, res); |
---|
| 254 | + virtbase = devm_platform_ioremap_resource(pdev, 0); |
---|
267 | 255 | if (IS_ERR(virtbase)) |
---|
268 | 256 | return PTR_ERR(virtbase); |
---|
269 | 257 | |
---|
.. | .. |
---|
408 | 396 | .driver = { |
---|
409 | 397 | .name = "coh901327_wdog", |
---|
410 | 398 | .of_match_table = coh901327_dt_match, |
---|
| 399 | + .suppress_bind_attrs = true, |
---|
411 | 400 | }, |
---|
412 | | - .remove = __exit_p(coh901327_remove), |
---|
413 | 401 | .suspend = coh901327_suspend, |
---|
414 | 402 | .resume = coh901327_resume, |
---|
415 | 403 | }; |
---|
| 404 | +builtin_platform_driver_probe(coh901327_driver, coh901327_probe); |
---|
416 | 405 | |
---|
417 | | -module_platform_driver_probe(coh901327_driver, coh901327_probe); |
---|
418 | | - |
---|
419 | | -MODULE_AUTHOR("Linus Walleij <linus.walleij@stericsson.com>"); |
---|
420 | | -MODULE_DESCRIPTION("COH 901 327 Watchdog"); |
---|
421 | | - |
---|
| 406 | +/* not really modular, but ... */ |
---|
422 | 407 | module_param(margin, uint, 0); |
---|
423 | 408 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)"); |
---|
424 | | - |
---|
425 | | -MODULE_LICENSE("GPL v2"); |
---|
426 | | -MODULE_ALIAS("platform:coh901327-watchdog"); |
---|