Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: rc32434_wdt: use devm_ioremap_nocache() functions

Use devm_ioremap_nocache() functions to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

authored by

Jingoo Han and committed by
Wim Van Sebroeck
52ccc5ac 3666eb02

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