Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263347
b: refs/heads/master
c: 62d1760
h: refs/heads/master
i:
  263345: 77d7c80
  263343: 8c38619
v: v3
  • Loading branch information
MyungJoo Ham authored and Linus Torvalds committed Aug 26, 2011
1 parent 9662efa commit 1d156b7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 43 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: 4e8896cde182b4eab6f2d0af9b6eef87720fae0d
refs/heads/master: 62d1760180c84cba68cc83696fa0bde0593007bd
67 changes: 25 additions & 42 deletions trunk/drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,49 +319,7 @@ static int s3c_rtc_proc(struct device *dev, struct seq_file *seq)
return 0;
}

static int s3c_rtc_open(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct rtc_device *rtc_dev = platform_get_drvdata(pdev);
int ret;

ret = request_irq(s3c_rtc_alarmno, s3c_rtc_alarmirq,
IRQF_DISABLED, "s3c2410-rtc alarm", rtc_dev);

if (ret) {
dev_err(dev, "IRQ%d error %d\n", s3c_rtc_alarmno, ret);
return ret;
}

ret = request_irq(s3c_rtc_tickno, s3c_rtc_tickirq,
IRQF_DISABLED, "s3c2410-rtc tick", rtc_dev);

if (ret) {
dev_err(dev, "IRQ%d error %d\n", s3c_rtc_tickno, ret);
goto tick_err;
}

return ret;

tick_err:
free_irq(s3c_rtc_alarmno, rtc_dev);
return ret;
}

static void s3c_rtc_release(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct rtc_device *rtc_dev = platform_get_drvdata(pdev);

/* do not clear AIE here, it may be needed for wake */

free_irq(s3c_rtc_alarmno, rtc_dev);
free_irq(s3c_rtc_tickno, rtc_dev);
}

static const struct rtc_class_ops s3c_rtcops = {
.open = s3c_rtc_open,
.release = s3c_rtc_release,
.read_time = s3c_rtc_gettime,
.set_time = s3c_rtc_settime,
.read_alarm = s3c_rtc_getalarm,
Expand Down Expand Up @@ -425,6 +383,9 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev)
{
struct rtc_device *rtc = platform_get_drvdata(dev);

free_irq(s3c_rtc_alarmno, rtc);
free_irq(s3c_rtc_tickno, rtc);

platform_set_drvdata(dev, NULL);
rtc_device_unregister(rtc);

Expand Down Expand Up @@ -548,10 +509,32 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)

s3c_rtc_setfreq(&pdev->dev, 1);

ret = request_irq(s3c_rtc_alarmno, s3c_rtc_alarmirq,
IRQF_DISABLED, "s3c2410-rtc alarm", rtc);
if (ret) {
dev_err(&pdev->dev, "IRQ%d error %d\n", s3c_rtc_alarmno, ret);
goto err_alarm_irq;
}

ret = request_irq(s3c_rtc_tickno, s3c_rtc_tickirq,
IRQF_DISABLED, "s3c2410-rtc tick", rtc);
if (ret) {
dev_err(&pdev->dev, "IRQ%d error %d\n", s3c_rtc_tickno, ret);
free_irq(s3c_rtc_alarmno, rtc);
goto err_tick_irq;
}

clk_disable(rtc_clk);

return 0;

err_tick_irq:
free_irq(s3c_rtc_alarmno, rtc);

err_alarm_irq:
platform_set_drvdata(pdev, NULL);
rtc_device_unregister(rtc);

err_nortc:
s3c_rtc_enable(pdev, 0);
clk_disable(rtc_clk);
Expand Down

0 comments on commit 1d156b7

Please sign in to comment.