Skip to content

Commit 0f310a0

Browse files
Thomas Abrahamcjb
authored andcommitted
mmc: sdhci-s3c: use clk_prepare_enable and clk_disable_unprepare
Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare calls as required by common clock framework. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
1 parent 8e2b36e commit 0f310a0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

drivers/mmc/host/sdhci-s3c.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)
211211
if (ourhost->cur_clk != best_src) {
212212
struct clk *clk = ourhost->clk_bus[best_src];
213213

214-
clk_enable(clk);
215-
clk_disable(ourhost->clk_bus[ourhost->cur_clk]);
214+
clk_prepare_enable(clk);
215+
clk_disable_unprepare(ourhost->clk_bus[ourhost->cur_clk]);
216216

217217
/* turn clock off to card before changing clock source */
218218
writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL);
@@ -607,7 +607,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
607607
}
608608

609609
/* enable the local io clock and keep it running for the moment. */
610-
clk_enable(sc->clk_io);
610+
clk_prepare_enable(sc->clk_io);
611611

612612
for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
613613
struct clk *clk;
@@ -638,7 +638,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
638638
}
639639

640640
#ifndef CONFIG_PM_RUNTIME
641-
clk_enable(sc->clk_bus[sc->cur_clk]);
641+
clk_prepare_enable(sc->clk_bus[sc->cur_clk]);
642642
#endif
643643

644644
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -747,13 +747,13 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
747747
sdhci_s3c_setup_card_detect_gpio(sc);
748748

749749
#ifdef CONFIG_PM_RUNTIME
750-
clk_disable(sc->clk_io);
750+
clk_disable_unprepare(sc->clk_io);
751751
#endif
752752
return 0;
753753

754754
err_req_regs:
755755
#ifndef CONFIG_PM_RUNTIME
756-
clk_disable(sc->clk_bus[sc->cur_clk]);
756+
clk_disable_unprepare(sc->clk_bus[sc->cur_clk]);
757757
#endif
758758
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
759759
if (sc->clk_bus[ptr]) {
@@ -762,7 +762,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
762762
}
763763

764764
err_no_busclks:
765-
clk_disable(sc->clk_io);
765+
clk_disable_unprepare(sc->clk_io);
766766
clk_put(sc->clk_io);
767767

768768
err_io_clk:
@@ -794,22 +794,22 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
794794
gpio_free(sc->ext_cd_gpio);
795795

796796
#ifdef CONFIG_PM_RUNTIME
797-
clk_enable(sc->clk_io);
797+
clk_prepare_enable(sc->clk_io);
798798
#endif
799799
sdhci_remove_host(host, 1);
800800

801801
pm_runtime_dont_use_autosuspend(&pdev->dev);
802802
pm_runtime_disable(&pdev->dev);
803803

804804
#ifndef CONFIG_PM_RUNTIME
805-
clk_disable(sc->clk_bus[sc->cur_clk]);
805+
clk_disable_unprepare(sc->clk_bus[sc->cur_clk]);
806806
#endif
807807
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
808808
if (sc->clk_bus[ptr]) {
809809
clk_put(sc->clk_bus[ptr]);
810810
}
811811
}
812-
clk_disable(sc->clk_io);
812+
clk_disable_unprepare(sc->clk_io);
813813
clk_put(sc->clk_io);
814814

815815
if (pdev->dev.of_node) {
@@ -849,8 +849,8 @@ static int sdhci_s3c_runtime_suspend(struct device *dev)
849849

850850
ret = sdhci_runtime_suspend_host(host);
851851

852-
clk_disable(ourhost->clk_bus[ourhost->cur_clk]);
853-
clk_disable(busclk);
852+
clk_disable_unprepare(ourhost->clk_bus[ourhost->cur_clk]);
853+
clk_disable_unprepare(busclk);
854854
return ret;
855855
}
856856

@@ -861,8 +861,8 @@ static int sdhci_s3c_runtime_resume(struct device *dev)
861861
struct clk *busclk = ourhost->clk_io;
862862
int ret;
863863

864-
clk_enable(busclk);
865-
clk_enable(ourhost->clk_bus[ourhost->cur_clk]);
864+
clk_prepare_enable(busclk);
865+
clk_prepare_enable(ourhost->clk_bus[ourhost->cur_clk]);
866866
ret = sdhci_runtime_resume_host(host);
867867
return ret;
868868
}

0 commit comments

Comments
 (0)