diff options
-rw-r--r-- | drivers/watchdog/rc32434_wdt.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c index f78bc008cbb7..9cf6bc7a234f 100644 --- a/drivers/watchdog/rc32434_wdt.c +++ b/drivers/watchdog/rc32434_wdt.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/platform_device.h> /* For platform_driver framework */ | 32 | #include <linux/platform_device.h> /* For platform_driver framework */ |
33 | #include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */ | 33 | #include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */ |
34 | #include <linux/uaccess.h> /* For copy_to_user/put_user/... */ | 34 | #include <linux/uaccess.h> /* For copy_to_user/put_user/... */ |
35 | #include <linux/io.h> /* For devm_ioremap_nocache */ | ||
35 | 36 | ||
36 | #include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */ | 37 | #include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */ |
37 | 38 | ||
@@ -271,7 +272,7 @@ static int rc32434_wdt_probe(struct platform_device *pdev) | |||
271 | return -ENODEV; | 272 | return -ENODEV; |
272 | } | 273 | } |
273 | 274 | ||
274 | wdt_reg = ioremap_nocache(r->start, resource_size(r)); | 275 | wdt_reg = devm_ioremap_nocache(&pdev->dev, r->start, resource_size(r)); |
275 | if (!wdt_reg) { | 276 | if (!wdt_reg) { |
276 | pr_err("failed to remap I/O resources\n"); | 277 | pr_err("failed to remap I/O resources\n"); |
277 | return -ENXIO; | 278 | return -ENXIO; |
@@ -293,23 +294,18 @@ static int rc32434_wdt_probe(struct platform_device *pdev) | |||
293 | ret = misc_register(&rc32434_wdt_miscdev); | 294 | ret = misc_register(&rc32434_wdt_miscdev); |
294 | if (ret < 0) { | 295 | if (ret < 0) { |
295 | pr_err("failed to register watchdog device\n"); | 296 | pr_err("failed to register watchdog device\n"); |
296 | goto unmap; | 297 | return ret; |
297 | } | 298 | } |
298 | 299 | ||
299 | pr_info("Watchdog Timer version " VERSION ", timer margin: %d sec\n", | 300 | pr_info("Watchdog Timer version " VERSION ", timer margin: %d sec\n", |
300 | timeout); | 301 | timeout); |
301 | 302 | ||
302 | return 0; | 303 | return 0; |
303 | |||
304 | unmap: | ||
305 | iounmap(wdt_reg); | ||
306 | return ret; | ||
307 | } | 304 | } |
308 | 305 | ||
309 | static int rc32434_wdt_remove(struct platform_device *pdev) | 306 | static int rc32434_wdt_remove(struct platform_device *pdev) |
310 | { | 307 | { |
311 | misc_deregister(&rc32434_wdt_miscdev); | 308 | misc_deregister(&rc32434_wdt_miscdev); |
312 | iounmap(wdt_reg); | ||
313 | return 0; | 309 | return 0; |
314 | } | 310 | } |
315 | 311 | ||