aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-04-29 16:21:05 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:28:40 -0700
commit3427de92ac70a064098ff843c72ac76c420bb1cb (patch)
tree8aa365f029cd901b9e5d6f3d22c63692049462f5
parentb9d8c4603e043320093d7bf3e7343f2358340d1d (diff)
downloadlinux-3427de92ac70a064098ff843c72ac76c420bb1cb.tar.gz
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>
-rw-r--r--drivers/rtc/rtc-at91rm9200.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c
index a654071f57d..0eab77b2234 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)
"at91_rtc", pdev);
if (ret) {
dev_err(&pdev->dev, "IRQ %d already in use.\n", irq);
- return ret;
+ goto err_unmap;
}
/* cpu init code should really have flagged this device as
@@ -311,13 +311,20 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
rtc = rtc_device_register(pdev->name, &pdev->dev,
&at91_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc)) {
- free_irq(irq, pdev);
- return PTR_ERR(rtc);
+ ret = PTR_ERR(rtc);
+ goto err_free_irq;
}
platform_set_drvdata(pdev, rtc);
dev_info(&pdev->dev, "AT91 Real Time Clock driver.\n");
return 0;
+
+err_free_irq:
+ free_irq(irq, pdev);
+err_unmap:
+ iounmap(at91_rtc_regs);
+
+ return ret;
}
/*
@@ -334,6 +341,7 @@ static int __exit at91_rtc_remove(struct platform_device *pdev)
free_irq(irq, pdev);
rtc_device_unregister(rtc);
+ iounmap(at91_rtc_regs);
platform_set_drvdata(pdev, NULL);
return 0;