提交 52ccc5ac 编写于 作者: J Jingoo Han 提交者: Wim Van Sebroeck

watchdog: rc32434_wdt: use devm_ioremap_nocache() functions

Use devm_ioremap_nocache() functions to make cleanup paths simpler.
Signed-off-by: NJingoo Han <jg1.han@samsung.com>
Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 3666eb02
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/platform_device.h> /* For platform_driver framework */ #include <linux/platform_device.h> /* For platform_driver framework */
#include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */ #include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */
#include <linux/uaccess.h> /* For copy_to_user/put_user/... */ #include <linux/uaccess.h> /* For copy_to_user/put_user/... */
#include <linux/io.h> /* For devm_ioremap_nocache */
#include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */ #include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */
...@@ -271,7 +272,7 @@ static int rc32434_wdt_probe(struct platform_device *pdev) ...@@ -271,7 +272,7 @@ static int rc32434_wdt_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
wdt_reg = ioremap_nocache(r->start, resource_size(r)); wdt_reg = devm_ioremap_nocache(&pdev->dev, r->start, resource_size(r));
if (!wdt_reg) { if (!wdt_reg) {
pr_err("failed to remap I/O resources\n"); pr_err("failed to remap I/O resources\n");
return -ENXIO; return -ENXIO;
...@@ -293,23 +294,18 @@ static int rc32434_wdt_probe(struct platform_device *pdev) ...@@ -293,23 +294,18 @@ static int rc32434_wdt_probe(struct platform_device *pdev)
ret = misc_register(&rc32434_wdt_miscdev); ret = misc_register(&rc32434_wdt_miscdev);
if (ret < 0) { if (ret < 0) {
pr_err("failed to register watchdog device\n"); pr_err("failed to register watchdog device\n");
goto unmap; return ret;
} }
pr_info("Watchdog Timer version " VERSION ", timer margin: %d sec\n", pr_info("Watchdog Timer version " VERSION ", timer margin: %d sec\n",
timeout); timeout);
return 0; return 0;
unmap:
iounmap(wdt_reg);
return ret;
} }
static int rc32434_wdt_remove(struct platform_device *pdev) static int rc32434_wdt_remove(struct platform_device *pdev)
{ {
misc_deregister(&rc32434_wdt_miscdev); misc_deregister(&rc32434_wdt_miscdev);
iounmap(wdt_reg);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册