Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319944
b: refs/heads/master
c: 8384dfe
h: refs/heads/master
v: v3
  • Loading branch information
Linus Walleij authored and Linus Torvalds committed Jul 31, 2012
1 parent 9542b9a commit 0dcf90e
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 261eba73353edd48b0c0cb7aad59553dfc712ebc
refs/heads/master: 8384dfeb759acac48ea24b81f134cac3cbb3e6fc
11 changes: 8 additions & 3 deletions trunk/drivers/rtc/rtc-coh901331.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static int __exit coh901331_remove(struct platform_device *pdev)
if (rtap) {
free_irq(rtap->irq, rtap);
rtc_device_unregister(rtap->rtc);
clk_unprepare(rtap->clk);
clk_put(rtap->clk);
iounmap(rtap->virtbase);
release_mem_region(rtap->phybase, rtap->physize);
Expand Down Expand Up @@ -213,10 +214,10 @@ static int __init coh901331_probe(struct platform_device *pdev)
}

/* We enable/disable the clock only to assure it works */
ret = clk_enable(rtap->clk);
ret = clk_prepare_enable(rtap->clk);
if (ret) {
dev_err(&pdev->dev, "could not enable clock\n");
goto out_no_clk_enable;
goto out_no_clk_prepenable;
}
clk_disable(rtap->clk);

Expand All @@ -232,7 +233,8 @@ static int __init coh901331_probe(struct platform_device *pdev)

out_no_rtc:
platform_set_drvdata(pdev, NULL);
out_no_clk_enable:
clk_unprepare(rtap->clk);
out_no_clk_prepenable:
clk_put(rtap->clk);
out_no_clk:
free_irq(rtap->irq, rtap);
Expand Down Expand Up @@ -265,13 +267,15 @@ static int coh901331_suspend(struct platform_device *pdev, pm_message_t state)
writel(0, rtap->virtbase + COH901331_IRQ_MASK);
clk_disable(rtap->clk);
}
clk_unprepare(rtap->clk);
return 0;
}

static int coh901331_resume(struct platform_device *pdev)
{
struct coh901331_port *rtap = dev_get_drvdata(&pdev->dev);

clk_prepare(rtap->clk);
if (device_may_wakeup(&pdev->dev)) {
disable_irq_wake(rtap->irq);
} else {
Expand All @@ -293,6 +297,7 @@ static void coh901331_shutdown(struct platform_device *pdev)
clk_enable(rtap->clk);
writel(0, rtap->virtbase + COH901331_IRQ_MASK);
clk_disable(rtap->clk);
clk_unprepare(rtap->clk);
}

static struct platform_driver coh901331_driver = {
Expand Down

0 comments on commit 0dcf90e

Please sign in to comment.