Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208787
b: refs/heads/master
c: e48add8
h: refs/heads/master
i:
  208785: 11a709a
  208783: c07c14f
v: v3
  • Loading branch information
Atul Dahiya authored and Kukjin Kim committed Aug 5, 2010
1 parent 11b20e8 commit 7339936
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 32fc7fb3b9b3e4b9361bda2d42921f71fe279d77
refs/heads/master: e48add8c1c462fb10d6297b739a57ef599eb02ae
22 changes: 22 additions & 0 deletions trunk/drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* drivers/rtc/rtc-s3c.c
*
* Copyright (c) 2010 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
* Copyright (c) 2004,2006 Simtec Electronics
* Ben Dooks, <ben@simtec.co.uk>
Expand Down Expand Up @@ -39,6 +42,7 @@ enum s3c_cpu_type {

static struct resource *s3c_rtc_mem;

static struct clk *rtc_clk;
static void __iomem *s3c_rtc_base;
static int s3c_rtc_alarmno = NO_IRQ;
static int s3c_rtc_tickno = NO_IRQ;
Expand Down Expand Up @@ -431,6 +435,10 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev)
s3c_rtc_setpie(&dev->dev, 0);
s3c_rtc_setaie(0);

clk_disable(rtc_clk);
clk_put(rtc_clk);
rtc_clk = NULL;

iounmap(s3c_rtc_base);
release_resource(s3c_rtc_mem);
kfree(s3c_rtc_mem);
Expand Down Expand Up @@ -488,6 +496,16 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
goto err_nomap;
}

rtc_clk = clk_get(&pdev->dev, "rtc");
if (IS_ERR(rtc_clk)) {
dev_err(&pdev->dev, "failed to find rtc clock source\n");
ret = PTR_ERR(rtc_clk);
rtc_clk = NULL;
goto err_clk;
}

clk_enable(rtc_clk);

/* check to see if everything is setup correctly */

s3c_rtc_enable(pdev, 1);
Expand Down Expand Up @@ -523,6 +541,10 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)

err_nortc:
s3c_rtc_enable(pdev, 0);
clk_disable(rtc_clk);
clk_put(rtc_clk);

err_clk:
iounmap(s3c_rtc_base);

err_nomap:
Expand Down

0 comments on commit 7339936

Please sign in to comment.