aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorAndrew Victor <andrew@sanpeople.com>2006-10-23 08:46:54 -0400
committerPierre Ossman <drzeus@drzeus.cx>2006-12-11 03:47:02 -0500
commit3dd3b039d489dfbc907c64a161fd2231ddcdea48 (patch)
tree9472513ca1e045b2a04c0e7eba617dbcb6f6c1a4 /drivers/mmc
parent17ea0595f4e89932ac9297a3850fba8b4ecb461e (diff)
AT91 MMC 3 : Move global mci_clk variable
Move the global 'mci_clk' variable into the local 'at91mci_host' structure. Signed-off-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/at91_mci.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/mmc/at91_mci.c b/drivers/mmc/at91_mci.c
index 9a6251a7815d..567119e93dff 100644
--- a/drivers/mmc/at91_mci.c
+++ b/drivers/mmc/at91_mci.c
@@ -80,8 +80,6 @@
80 80
81#undef SUPPORT_4WIRE 81#undef SUPPORT_4WIRE
82 82
83static struct clk *mci_clk;
84
85#define FL_SENT_COMMAND (1 << 0) 83#define FL_SENT_COMMAND (1 << 0)
86#define FL_SENT_STOP (1 << 1) 84#define FL_SENT_STOP (1 << 1)
87 85
@@ -106,6 +104,8 @@ struct at91mci_host
106 struct at91_mmc_data *board; 104 struct at91_mmc_data *board;
107 int present; 105 int present;
108 106
107 struct clk *mci_clk;
108
109 /* 109 /*
110 * Flag indicating when the command has been sent. This is used to 110 * Flag indicating when the command has been sent. This is used to
111 * work out whether or not to send the stop 111 * work out whether or not to send the stop
@@ -598,7 +598,7 @@ static void at91_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
598{ 598{
599 int clkdiv; 599 int clkdiv;
600 struct at91mci_host *host = mmc_priv(mmc); 600 struct at91mci_host *host = mmc_priv(mmc);
601 unsigned long at91_master_clock = clk_get_rate(mci_clk); 601 unsigned long at91_master_clock = clk_get_rate(host->mci_clk);
602 602
603 host->bus_mode = ios->bus_mode; 603 host->bus_mode = ios->bus_mode;
604 604
@@ -834,8 +834,8 @@ static int at91_mci_probe(struct platform_device *pdev)
834 /* 834 /*
835 * Get Clock 835 * Get Clock
836 */ 836 */
837 mci_clk = clk_get(&pdev->dev, "mci_clk"); 837 host->mci_clk = clk_get(&pdev->dev, "mci_clk");
838 if (IS_ERR(mci_clk)) { 838 if (IS_ERR(host->mci_clk)) {
839 printk(KERN_ERR "AT91 MMC: no clock defined.\n"); 839 printk(KERN_ERR "AT91 MMC: no clock defined.\n");
840 mmc_free_host(mmc); 840 mmc_free_host(mmc);
841 release_mem_region(res->start, res->end - res->start + 1); 841 release_mem_region(res->start, res->end - res->start + 1);
@@ -847,7 +847,7 @@ static int at91_mci_probe(struct platform_device *pdev)
847 */ 847 */
848 host->baseaddr = ioremap(res->start, res->end - res->start + 1); 848 host->baseaddr = ioremap(res->start, res->end - res->start + 1);
849 if (!host->baseaddr) { 849 if (!host->baseaddr) {
850 clk_put(mci_clk); 850 clk_put(host->mci_clk);
851 mmc_free_host(mmc); 851 mmc_free_host(mmc);
852 release_mem_region(res->start, res->end - res->start + 1); 852 release_mem_region(res->start, res->end - res->start + 1);
853 return -ENOMEM; 853 return -ENOMEM;
@@ -856,7 +856,7 @@ static int at91_mci_probe(struct platform_device *pdev)
856 /* 856 /*
857 * Reset hardware 857 * Reset hardware
858 */ 858 */
859 clk_enable(mci_clk); /* Enable the peripheral clock */ 859 clk_enable(host->mci_clk); /* Enable the peripheral clock */
860 at91_mci_disable(host); 860 at91_mci_disable(host);
861 at91_mci_enable(host); 861 at91_mci_enable(host);
862 862
@@ -867,8 +867,8 @@ static int at91_mci_probe(struct platform_device *pdev)
867 ret = request_irq(host->irq, at91_mci_irq, IRQF_SHARED, DRIVER_NAME, host); 867 ret = request_irq(host->irq, at91_mci_irq, IRQF_SHARED, DRIVER_NAME, host);
868 if (ret) { 868 if (ret) {
869 printk(KERN_ERR "Failed to request MCI interrupt\n"); 869 printk(KERN_ERR "Failed to request MCI interrupt\n");
870 clk_disable(mci_clk); 870 clk_disable(host->mci_clk);
871 clk_put(mci_clk); 871 clk_put(host->mci_clk);
872 mmc_free_host(mmc); 872 mmc_free_host(mmc);
873 iounmap(host->baseaddr); 873 iounmap(host->baseaddr);
874 release_mem_region(res->start, res->end - res->start + 1); 874 release_mem_region(res->start, res->end - res->start + 1);
@@ -925,8 +925,8 @@ static int at91_mci_remove(struct platform_device *pdev)
925 mmc_remove_host(mmc); 925 mmc_remove_host(mmc);
926 free_irq(host->irq, host); 926 free_irq(host->irq, host);
927 927
928 clk_disable(mci_clk); /* Disable the peripheral clock */ 928 clk_disable(host->mci_clk); /* Disable the peripheral clock */
929 clk_put(mci_clk); 929 clk_put(host->mci_clk);
930 930
931 iounmap(host->baseaddr); 931 iounmap(host->baseaddr);
932 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 932 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);