Skip to content

Commit

Permalink
watchdog: rc32434_wdt: use devm_ioremap_nocache() functions
Browse files Browse the repository at this point in the history
Use devm_ioremap_nocache() functions to make cleanup paths simpler.

Signed-off-by: Jingoo Han <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
  • Loading branch information
Jingoo Han authored and Wim Van Sebroeck committed Jul 11, 2013
1 parent 3666eb0 commit 52ccc5a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/watchdog/rc32434_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/platform_device.h> /* For platform_driver framework */
#include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */
#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 */

Expand Down Expand Up @@ -271,7 +272,7 @@ static int rc32434_wdt_probe(struct platform_device *pdev)
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) {
pr_err("failed to remap I/O resources\n");
return -ENXIO;
Expand All @@ -293,23 +294,18 @@ static int rc32434_wdt_probe(struct platform_device *pdev)
ret = misc_register(&rc32434_wdt_miscdev);
if (ret < 0) {
pr_err("failed to register watchdog device\n");
goto unmap;
return ret;
}

pr_info("Watchdog Timer version " VERSION ", timer margin: %d sec\n",
timeout);

return 0;

unmap:
iounmap(wdt_reg);
return ret;
}

static int rc32434_wdt_remove(struct platform_device *pdev)
{
misc_deregister(&rc32434_wdt_miscdev);
iounmap(wdt_reg);
return 0;
}

Expand Down

0 comments on commit 52ccc5a

Please sign in to comment.