Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208469
b: refs/heads/master
c: 23e53be
h: refs/heads/master
i:
  208467: 03c80b1
v: v3
  • Loading branch information
Wan ZongShun authored and Linus Torvalds committed Aug 11, 2010
1 parent 5b2f5aa commit c1f936a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 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: 84f20a6928bb2b8e5f7ab50686bdf1566479363a
refs/heads/master: 23e53be94a7bf9220e1e3d8b0b56b8c96cb88e3c
23 changes: 12 additions & 11 deletions trunk/drivers/rtc/rtc-nuc900.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,29 +269,30 @@ static int __devinit nuc900_rtc_probe(struct platform_device *pdev)
goto fail2;
}

nuc900_rtc->irq_num = platform_get_irq(pdev, 0);
if (request_irq(nuc900_rtc->irq_num, nuc900_rtc_interrupt,
IRQF_DISABLED, "nuc900rtc", nuc900_rtc)) {
dev_err(&pdev->dev, "NUC900 RTC request irq failed\n");
err = -EBUSY;
goto fail3;
}
platform_set_drvdata(pdev, nuc900_rtc);

nuc900_rtc->rtcdev = rtc_device_register(pdev->name, &pdev->dev,
&nuc900_rtc_ops, THIS_MODULE);
if (IS_ERR(nuc900_rtc->rtcdev)) {
dev_err(&pdev->dev, "rtc device register faild\n");
err = PTR_ERR(nuc900_rtc->rtcdev);
goto fail4;
goto fail3;
}

platform_set_drvdata(pdev, nuc900_rtc);
__raw_writel(__raw_readl(nuc900_rtc->rtc_reg + REG_RTC_TSSR) | MODE24,
nuc900_rtc->rtc_reg + REG_RTC_TSSR);

nuc900_rtc->irq_num = platform_get_irq(pdev, 0);
if (request_irq(nuc900_rtc->irq_num, nuc900_rtc_interrupt,
IRQF_DISABLED, "nuc900rtc", nuc900_rtc)) {
dev_err(&pdev->dev, "NUC900 RTC request irq failed\n");
err = -EBUSY;
goto fail4;
}

return 0;

fail4: free_irq(nuc900_rtc->irq_num, nuc900_rtc);
fail4: rtc_device_unregister(nuc900_rtc->rtcdev);
fail3: iounmap(nuc900_rtc->rtc_reg);
fail2: release_mem_region(res->start, resource_size(res));
fail1: kfree(nuc900_rtc);
Expand All @@ -303,8 +304,8 @@ static int __devexit nuc900_rtc_remove(struct platform_device *pdev)
struct nuc900_rtc *nuc900_rtc = platform_get_drvdata(pdev);
struct resource *res;

rtc_device_unregister(nuc900_rtc->rtcdev);
free_irq(nuc900_rtc->irq_num, nuc900_rtc);
rtc_device_unregister(nuc900_rtc->rtcdev);
iounmap(nuc900_rtc->rtc_reg);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Expand Down

0 comments on commit c1f936a

Please sign in to comment.