diff mbox

[2/2] sdhci: sdhci-pxa.c add host->ops to configure f_max

Message ID 7B48DA54-6A2E-4736-90AA-F8D8D9C0BA02@marvell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Philip Rakity Feb. 14, 2011, 7:11 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci-pxa.c b/drivers/mmc/host/sdhci-pxa.c
index 0e64d66..3d01f94 100644
--- a/drivers/mmc/host/sdhci-pxa.c
+++ b/drivers/mmc/host/sdhci-pxa.c
@@ -94,8 +94,16 @@  static void platform_reset_exit(struct sdhci_host *host, u8 mask)
 	}
 }
 
+static unsigned int get_f_max_clock(struct sdhci_host *host)
+{
+	struct sdhci_pxa *pxa = sdhci_priv(host);
+
+	return pxa->pdata->max_speed;
+}
+
 static struct sdhci_ops sdhci_pxa_ops = {
 	.platform_reset_exit = platform_reset_exit,
+	.get_f_max_clock = NULL,
 };
 
 /*****************************************************************************\
@@ -184,15 +192,17 @@  static int __devinit sdhci_pxa_probe(struct platform_device *pdev)
 	/* do not rely on u-boot to enable the clocks */
 	enable_clock(host);
 
+	if (pxa->pdata->max_speed)
+		sdhci_pxa_ops.get_f_max_clock = get_f_max_clock;
+	else
+		sdhci_pxa_ops.get_f_max_clock = NULL;
+
 	ret = sdhci_add_host(host);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add host\n");
 		goto out;
 	}
 
-	if (pxa->pdata->max_speed)
-		host->mmc->f_max = pxa->pdata->max_speed;
-
 	platform_set_drvdata(pdev, host);
 
 	return 0;