aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorMarkus Mayer <markus.mayer@linaro.org>2014-07-03 16:27:42 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-07-09 05:26:11 -0400
commit4e743f1fc8bd24d1bc185e4d7b13f7b74c9c5423 (patch)
tree542226c7133ad590c8001e2c45649327e9238e34 /drivers/mmc/host
parent62ce34b0baedc283267e2dbc5d79ebef062dbda1 (diff)
mmc: sdhci: Replace host->mmc with mmc where possible
After the switch to the MMC core regulator infrastucture, we already have a local "mmc" pointer in various functions. There is no longer a need to access the data structure via host->mmc. Signed-off-by: Markus Mayer <markus.mayer@linaro.org> Reviewed-by: Matt Porter <mporter@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/sdhci.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ce092fbc9e47..37b2a9ae52ef 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1228,7 +1228,7 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
1228 1228
1229 if (!IS_ERR(mmc->supply.vmmc)) { 1229 if (!IS_ERR(mmc->supply.vmmc)) {
1230 spin_unlock_irq(&host->lock); 1230 spin_unlock_irq(&host->lock);
1231 mmc_regulator_set_ocr(host->mmc, mmc->supply.vmmc, vdd); 1231 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
1232 spin_lock_irq(&host->lock); 1232 spin_lock_irq(&host->lock);
1233 return; 1233 return;
1234 } 1234 }
@@ -1450,7 +1450,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
1450 spin_unlock_irqrestore(&host->lock, flags); 1450 spin_unlock_irqrestore(&host->lock, flags);
1451 if (!IS_ERR(mmc->supply.vmmc) && 1451 if (!IS_ERR(mmc->supply.vmmc) &&
1452 ios->power_mode == MMC_POWER_OFF) 1452 ios->power_mode == MMC_POWER_OFF)
1453 mmc_regulator_set_ocr(host->mmc, mmc->supply.vmmc, 0); 1453 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
1454 return; 1454 return;
1455 } 1455 }
1456 1456
@@ -1734,7 +1734,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
1734 3600000); 1734 3600000);
1735 if (ret) { 1735 if (ret) {
1736 pr_warning("%s: Switching to 3.3V signalling voltage " 1736 pr_warning("%s: Switching to 3.3V signalling voltage "
1737 " failed\n", mmc_hostname(host->mmc)); 1737 " failed\n", mmc_hostname(mmc));
1738 return -EIO; 1738 return -EIO;
1739 } 1739 }
1740 } 1740 }
@@ -1747,7 +1747,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
1747 return 0; 1747 return 0;
1748 1748
1749 pr_warning("%s: 3.3V regulator output did not became stable\n", 1749 pr_warning("%s: 3.3V regulator output did not became stable\n",
1750 mmc_hostname(host->mmc)); 1750 mmc_hostname(mmc));
1751 1751
1752 return -EAGAIN; 1752 return -EAGAIN;
1753 case MMC_SIGNAL_VOLTAGE_180: 1753 case MMC_SIGNAL_VOLTAGE_180:
@@ -1756,7 +1756,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
1756 1700000, 1950000); 1756 1700000, 1950000);
1757 if (ret) { 1757 if (ret) {
1758 pr_warning("%s: Switching to 1.8V signalling voltage " 1758 pr_warning("%s: Switching to 1.8V signalling voltage "
1759 " failed\n", mmc_hostname(host->mmc)); 1759 " failed\n", mmc_hostname(mmc));
1760 return -EIO; 1760 return -EIO;
1761 } 1761 }
1762 } 1762 }
@@ -1774,7 +1774,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
1774 return 0; 1774 return 0;
1775 1775
1776 pr_warning("%s: 1.8V regulator output did not became stable\n", 1776 pr_warning("%s: 1.8V regulator output did not became stable\n",
1777 mmc_hostname(host->mmc)); 1777 mmc_hostname(mmc));
1778 1778
1779 return -EAGAIN; 1779 return -EAGAIN;
1780 case MMC_SIGNAL_VOLTAGE_120: 1780 case MMC_SIGNAL_VOLTAGE_120:
@@ -1783,7 +1783,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
1783 1300000); 1783 1300000);
1784 if (ret) { 1784 if (ret) {
1785 pr_warning("%s: Switching to 1.2V signalling voltage " 1785 pr_warning("%s: Switching to 1.2V signalling voltage "
1786 " failed\n", mmc_hostname(host->mmc)); 1786 " failed\n", mmc_hostname(mmc));
1787 return -EIO; 1787 return -EIO;
1788 } 1788 }
1789 } 1789 }
@@ -2822,12 +2822,12 @@ int sdhci_add_host(struct sdhci_host *host)
2822 * (128) and potentially one alignment transfer for 2822 * (128) and potentially one alignment transfer for
2823 * each of those entries. 2823 * each of those entries.
2824 */ 2824 */
2825 host->adma_desc = dma_alloc_coherent(mmc_dev(host->mmc), 2825 host->adma_desc = dma_alloc_coherent(mmc_dev(mmc),
2826 ADMA_SIZE, &host->adma_addr, 2826 ADMA_SIZE, &host->adma_addr,
2827 GFP_KERNEL); 2827 GFP_KERNEL);
2828 host->align_buffer = kmalloc(128 * 4, GFP_KERNEL); 2828 host->align_buffer = kmalloc(128 * 4, GFP_KERNEL);
2829 if (!host->adma_desc || !host->align_buffer) { 2829 if (!host->adma_desc || !host->align_buffer) {
2830 dma_free_coherent(mmc_dev(host->mmc), ADMA_SIZE, 2830 dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
2831 host->adma_desc, host->adma_addr); 2831 host->adma_desc, host->adma_addr);
2832 kfree(host->align_buffer); 2832 kfree(host->align_buffer);
2833 pr_warning("%s: Unable to allocate ADMA " 2833 pr_warning("%s: Unable to allocate ADMA "
@@ -2840,7 +2840,7 @@ int sdhci_add_host(struct sdhci_host *host)
2840 pr_warning("%s: unable to allocate aligned ADMA descriptor\n", 2840 pr_warning("%s: unable to allocate aligned ADMA descriptor\n",
2841 mmc_hostname(mmc)); 2841 mmc_hostname(mmc));
2842 host->flags &= ~SDHCI_USE_ADMA; 2842 host->flags &= ~SDHCI_USE_ADMA;
2843 dma_free_coherent(mmc_dev(host->mmc), ADMA_SIZE, 2843 dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
2844 host->adma_desc, host->adma_addr); 2844 host->adma_desc, host->adma_addr);
2845 kfree(host->align_buffer); 2845 kfree(host->align_buffer);
2846 host->adma_desc = NULL; 2846 host->adma_desc = NULL;
@@ -2855,7 +2855,7 @@ int sdhci_add_host(struct sdhci_host *host)
2855 */ 2855 */
2856 if (!(host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA))) { 2856 if (!(host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA))) {
2857 host->dma_mask = DMA_BIT_MASK(64); 2857 host->dma_mask = DMA_BIT_MASK(64);
2858 mmc_dev(host->mmc)->dma_mask = &host->dma_mask; 2858 mmc_dev(mmc)->dma_mask = &host->dma_mask;
2859 } 2859 }
2860 2860
2861 if (host->version >= SDHCI_SPEC_300) 2861 if (host->version >= SDHCI_SPEC_300)
@@ -2961,7 +2961,7 @@ int sdhci_add_host(struct sdhci_host *host)
2961 mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; 2961 mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
2962 2962
2963 if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) && 2963 if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
2964 !(host->mmc->caps & MMC_CAP_NONREMOVABLE)) 2964 !(mmc->caps & MMC_CAP_NONREMOVABLE))
2965 mmc->caps |= MMC_CAP_NEEDS_POLL; 2965 mmc->caps |= MMC_CAP_NEEDS_POLL;
2966 2966
2967 /* If there are external regulators, get them */ 2967 /* If there are external regulators, get them */
@@ -3258,7 +3258,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
3258 3258
3259 if (host->mrq) { 3259 if (host->mrq) {
3260 pr_err("%s: Controller removed during " 3260 pr_err("%s: Controller removed during "
3261 " transfer!\n", mmc_hostname(host->mmc)); 3261 " transfer!\n", mmc_hostname(mmc));
3262 3262
3263 host->mrq->cmd->error = -ENOMEDIUM; 3263 host->mrq->cmd->error = -ENOMEDIUM;
3264 tasklet_schedule(&host->finish_tasklet); 3264 tasklet_schedule(&host->finish_tasklet);
@@ -3269,7 +3269,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
3269 3269
3270 sdhci_disable_card_detection(host); 3270 sdhci_disable_card_detection(host);
3271 3271
3272 mmc_remove_host(host->mmc); 3272 mmc_remove_host(mmc);
3273 3273
3274#ifdef SDHCI_USE_LEDS_CLASS 3274#ifdef SDHCI_USE_LEDS_CLASS
3275 led_classdev_unregister(&host->led); 3275 led_classdev_unregister(&host->led);
@@ -3293,7 +3293,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
3293 regulator_disable(mmc->supply.vqmmc); 3293 regulator_disable(mmc->supply.vqmmc);
3294 3294
3295 if (host->adma_desc) 3295 if (host->adma_desc)
3296 dma_free_coherent(mmc_dev(host->mmc), ADMA_SIZE, 3296 dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
3297 host->adma_desc, host->adma_addr); 3297 host->adma_desc, host->adma_addr);
3298 kfree(host->align_buffer); 3298 kfree(host->align_buffer);
3299 3299