diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-30 01:00:33 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2013-07-11 14:53:44 -0400 |
commit | 626d65aa5255fdd98e62f74cf43d3166e9832fb2 (patch) | |
tree | cff1d9d59a67b5e757f72a0f531d5675e0ff5e22 /drivers/watchdog | |
parent | 321e31231d781aa91e94e8e3974db1edb428b6a4 (diff) |
watchdog: bcm63xx_wdt: use devm_ioremap_nocache()
Use devm_ioremap_nocache() to make cleanup paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/bcm63xx_wdt.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/watchdog/bcm63xx_wdt.c b/drivers/watchdog/bcm63xx_wdt.c index b2b80d4ac818..a14a58d9d110 100644 --- a/drivers/watchdog/bcm63xx_wdt.c +++ b/drivers/watchdog/bcm63xx_wdt.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/io.h> | ||
19 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
20 | #include <linux/miscdevice.h> | 21 | #include <linux/miscdevice.h> |
21 | #include <linux/module.h> | 22 | #include <linux/module.h> |
@@ -249,7 +250,8 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev) | |||
249 | return -ENODEV; | 250 | return -ENODEV; |
250 | } | 251 | } |
251 | 252 | ||
252 | bcm63xx_wdt_device.regs = ioremap_nocache(r->start, resource_size(r)); | 253 | bcm63xx_wdt_device.regs = devm_ioremap_nocache(&pdev->dev, r->start, |
254 | resource_size(r)); | ||
253 | if (!bcm63xx_wdt_device.regs) { | 255 | if (!bcm63xx_wdt_device.regs) { |
254 | dev_err(&pdev->dev, "failed to remap I/O resources\n"); | 256 | dev_err(&pdev->dev, "failed to remap I/O resources\n"); |
255 | return -ENXIO; | 257 | return -ENXIO; |
@@ -258,7 +260,7 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev) | |||
258 | ret = bcm63xx_timer_register(TIMER_WDT_ID, bcm63xx_wdt_isr, NULL); | 260 | ret = bcm63xx_timer_register(TIMER_WDT_ID, bcm63xx_wdt_isr, NULL); |
259 | if (ret < 0) { | 261 | if (ret < 0) { |
260 | dev_err(&pdev->dev, "failed to register wdt timer isr\n"); | 262 | dev_err(&pdev->dev, "failed to register wdt timer isr\n"); |
261 | goto unmap; | 263 | return ret; |
262 | } | 264 | } |
263 | 265 | ||
264 | if (bcm63xx_wdt_settimeout(wdt_time)) { | 266 | if (bcm63xx_wdt_settimeout(wdt_time)) { |
@@ -281,8 +283,6 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev) | |||
281 | 283 | ||
282 | unregister_timer: | 284 | unregister_timer: |
283 | bcm63xx_timer_unregister(TIMER_WDT_ID); | 285 | bcm63xx_timer_unregister(TIMER_WDT_ID); |
284 | unmap: | ||
285 | iounmap(bcm63xx_wdt_device.regs); | ||
286 | return ret; | 286 | return ret; |
287 | } | 287 | } |
288 | 288 | ||
@@ -293,7 +293,6 @@ static int bcm63xx_wdt_remove(struct platform_device *pdev) | |||
293 | 293 | ||
294 | misc_deregister(&bcm63xx_wdt_miscdev); | 294 | misc_deregister(&bcm63xx_wdt_miscdev); |
295 | bcm63xx_timer_unregister(TIMER_WDT_ID); | 295 | bcm63xx_timer_unregister(TIMER_WDT_ID); |
296 | iounmap(bcm63xx_wdt_device.regs); | ||
297 | return 0; | 296 | return 0; |
298 | } | 297 | } |
299 | 298 | ||