diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-04-29 19:21:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:40 -0400 |
commit | 3427de92ac70a064098ff843c72ac76c420bb1cb (patch) | |
tree | 8aa365f029cd901b9e5d6f3d22c63692049462f5 /drivers/rtc/rtc-at91rm9200.c | |
parent | b9d8c4603e043320093d7bf3e7343f2358340d1d (diff) |
drivers/rtc/rtc-at91rm9200.c: fix missing iounmap
Add missing iounmap to probe error path and remove.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-at91rm9200.c')
-rw-r--r-- | drivers/rtc/rtc-at91rm9200.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c index a654071f57df..0eab77b22340 100644 --- a/drivers/rtc/rtc-at91rm9200.c +++ b/drivers/rtc/rtc-at91rm9200.c | |||
@@ -299,7 +299,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev) | |||
299 | "at91_rtc", pdev); | 299 | "at91_rtc", pdev); |
300 | if (ret) { | 300 | if (ret) { |
301 | dev_err(&pdev->dev, "IRQ %d already in use.\n", irq); | 301 | dev_err(&pdev->dev, "IRQ %d already in use.\n", irq); |
302 | return ret; | 302 | goto err_unmap; |
303 | } | 303 | } |
304 | 304 | ||
305 | /* cpu init code should really have flagged this device as | 305 | /* cpu init code should really have flagged this device as |
@@ -311,13 +311,20 @@ static int __init at91_rtc_probe(struct platform_device *pdev) | |||
311 | rtc = rtc_device_register(pdev->name, &pdev->dev, | 311 | rtc = rtc_device_register(pdev->name, &pdev->dev, |
312 | &at91_rtc_ops, THIS_MODULE); | 312 | &at91_rtc_ops, THIS_MODULE); |
313 | if (IS_ERR(rtc)) { | 313 | if (IS_ERR(rtc)) { |
314 | free_irq(irq, pdev); | 314 | ret = PTR_ERR(rtc); |
315 | return PTR_ERR(rtc); | 315 | goto err_free_irq; |
316 | } | 316 | } |
317 | platform_set_drvdata(pdev, rtc); | 317 | platform_set_drvdata(pdev, rtc); |
318 | 318 | ||
319 | dev_info(&pdev->dev, "AT91 Real Time Clock driver.\n"); | 319 | dev_info(&pdev->dev, "AT91 Real Time Clock driver.\n"); |
320 | return 0; | 320 | return 0; |
321 | |||
322 | err_free_irq: | ||
323 | free_irq(irq, pdev); | ||
324 | err_unmap: | ||
325 | iounmap(at91_rtc_regs); | ||
326 | |||
327 | return ret; | ||
321 | } | 328 | } |
322 | 329 | ||
323 | /* | 330 | /* |
@@ -334,6 +341,7 @@ static int __exit at91_rtc_remove(struct platform_device *pdev) | |||
334 | free_irq(irq, pdev); | 341 | free_irq(irq, pdev); |
335 | 342 | ||
336 | rtc_device_unregister(rtc); | 343 | rtc_device_unregister(rtc); |
344 | iounmap(at91_rtc_regs); | ||
337 | platform_set_drvdata(pdev, NULL); | 345 | platform_set_drvdata(pdev, NULL); |
338 | 346 | ||
339 | return 0; | 347 | return 0; |