Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296177
b: refs/heads/master
c: 4e9267f
h: refs/heads/master
i:
  296175: 8a7ed82
v: v3
  • Loading branch information
Jean-Christophe PLAGNIOL-VILLARD authored and Nicolas Ferre committed Feb 23, 2012
1 parent 2a05f96 commit ab55087
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 205056a3ea33f5aca7adffa4584eb6572b1d3273
refs/heads/master: 4e9267f1b42b4f7b66214161b55f1f73365692cd
13 changes: 10 additions & 3 deletions trunk/drivers/rtc/rtc-at91sam9.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,12 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, 1);

platform_set_drvdata(pdev, rtc);
rtc->rtt = (void __force __iomem *) (AT91_VA_BASE_SYS - AT91_BASE_SYS);
rtc->rtt += r->start;
rtc->rtt = ioremap(r->start, resource_size(r));
if (!rtc->rtt) {
dev_err(&pdev->dev, "failed to map registers, aborting.\n");
ret = -ENOMEM;
goto fail;
}

mr = rtt_readl(rtc, MR);

Expand All @@ -326,7 +330,7 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev)
&at91_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc->rtcdev)) {
ret = PTR_ERR(rtc->rtcdev);
goto fail;
goto fail_register;
}

/* register irq handler after we know what name we'll use */
Expand All @@ -351,6 +355,8 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev)

return 0;

fail_register:
iounmap(rtc->rtt);
fail:
platform_set_drvdata(pdev, NULL);
kfree(rtc);
Expand All @@ -371,6 +377,7 @@ static int __devexit at91_rtc_remove(struct platform_device *pdev)

rtc_device_unregister(rtc->rtcdev);

iounmap(rtc->rtt);
platform_set_drvdata(pdev, NULL);
kfree(rtc);
return 0;
Expand Down

0 comments on commit ab55087

Please sign in to comment.