提交 626d65aa 编写于 作者: J Jingoo Han 提交者: Wim Van Sebroeck

watchdog: bcm63xx_wdt: use devm_ioremap_nocache()

Use devm_ioremap_nocache() to make cleanup paths simpler.
Signed-off-by: NJingoo Han <jg1.han@samsung.com>
Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
Acked-by: NFlorian Fainelli <florian@openwrt.org>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 321e3123
......@@ -16,6 +16,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
......@@ -249,7 +250,8 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev)
return -ENODEV;
}
bcm63xx_wdt_device.regs = ioremap_nocache(r->start, resource_size(r));
bcm63xx_wdt_device.regs = devm_ioremap_nocache(&pdev->dev, r->start,
resource_size(r));
if (!bcm63xx_wdt_device.regs) {
dev_err(&pdev->dev, "failed to remap I/O resources\n");
return -ENXIO;
......@@ -258,7 +260,7 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev)
ret = bcm63xx_timer_register(TIMER_WDT_ID, bcm63xx_wdt_isr, NULL);
if (ret < 0) {
dev_err(&pdev->dev, "failed to register wdt timer isr\n");
goto unmap;
return ret;
}
if (bcm63xx_wdt_settimeout(wdt_time)) {
......@@ -281,8 +283,6 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev)
unregister_timer:
bcm63xx_timer_unregister(TIMER_WDT_ID);
unmap:
iounmap(bcm63xx_wdt_device.regs);
return ret;
}
......@@ -293,7 +293,6 @@ static int bcm63xx_wdt_remove(struct platform_device *pdev)
misc_deregister(&bcm63xx_wdt_miscdev);
bcm63xx_timer_unregister(TIMER_WDT_ID);
iounmap(bcm63xx_wdt_device.regs);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册