Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332843
b: refs/heads/master
c: e684c46
h: refs/heads/master
i:
  332841: 4e78eac
  332839: 40bda3f
v: v3
  • Loading branch information
Chander Kashyap authored and Chris Ball committed Oct 3, 2012
1 parent 4a4c815 commit a704c27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: 897b69e72054a39c1c1d99c8f334ffed6dc99ac4
refs/heads/master: e684c46876f1d0c1c4964741244a34b6be837b5f
12 changes: 7 additions & 5 deletions trunk/drivers/mmc/host/sdhci-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,12 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)
best_src, clock, best);

/* select the new clock source */

if (ourhost->cur_clk != best_src) {
struct clk *clk = ourhost->clk_bus[best_src];

clk_enable(clk);
clk_disable(ourhost->clk_bus[ourhost->cur_clk]);

/* turn clock off to card before changing clock source */
writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL);

Expand Down Expand Up @@ -625,8 +627,6 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
*/
sc->cur_clk = ptr;

clk_enable(clk);

dev_info(dev, "clock source %d: %s (%ld Hz)\n",
ptr, name, clk_get_rate(clk));
}
Expand All @@ -637,6 +637,8 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
goto err_no_busclks;
}

clk_enable(sc->clk_bus[sc->cur_clk]);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
host->ioaddr = devm_request_and_ioremap(&pdev->dev, res);
if (!host->ioaddr) {
Expand Down Expand Up @@ -745,9 +747,9 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
return 0;

err_req_regs:
clk_disable(sc->clk_bus[sc->cur_clk]);
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
if (sc->clk_bus[ptr]) {
clk_disable(sc->clk_bus[ptr]);
clk_put(sc->clk_bus[ptr]);
}
}
Expand Down Expand Up @@ -788,9 +790,9 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)

pm_runtime_disable(&pdev->dev);

clk_disable(sc->clk_bus[sc->cur_clk]);
for (ptr = 0; ptr < 3; ptr++) {
if (sc->clk_bus[ptr]) {
clk_disable(sc->clk_bus[ptr]);
clk_put(sc->clk_bus[ptr]);
}
}
Expand Down

0 comments on commit a704c27

Please sign in to comment.