mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 04:34:11 +08:00
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>
This commit is contained in:
parent
62ce34b0ba
commit
4e743f1fc8
@ -1228,7 +1228,7 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
|
|||||||
|
|
||||||
if (!IS_ERR(mmc->supply.vmmc)) {
|
if (!IS_ERR(mmc->supply.vmmc)) {
|
||||||
spin_unlock_irq(&host->lock);
|
spin_unlock_irq(&host->lock);
|
||||||
mmc_regulator_set_ocr(host->mmc, mmc->supply.vmmc, vdd);
|
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
|
||||||
spin_lock_irq(&host->lock);
|
spin_lock_irq(&host->lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1450,7 +1450,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
|
|||||||
spin_unlock_irqrestore(&host->lock, flags);
|
spin_unlock_irqrestore(&host->lock, flags);
|
||||||
if (!IS_ERR(mmc->supply.vmmc) &&
|
if (!IS_ERR(mmc->supply.vmmc) &&
|
||||||
ios->power_mode == MMC_POWER_OFF)
|
ios->power_mode == MMC_POWER_OFF)
|
||||||
mmc_regulator_set_ocr(host->mmc, mmc->supply.vmmc, 0);
|
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1734,7 +1734,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
|
|||||||
3600000);
|
3600000);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_warning("%s: Switching to 3.3V signalling voltage "
|
pr_warning("%s: Switching to 3.3V signalling voltage "
|
||||||
" failed\n", mmc_hostname(host->mmc));
|
" failed\n", mmc_hostname(mmc));
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1747,7 +1747,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pr_warning("%s: 3.3V regulator output did not became stable\n",
|
pr_warning("%s: 3.3V regulator output did not became stable\n",
|
||||||
mmc_hostname(host->mmc));
|
mmc_hostname(mmc));
|
||||||
|
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
case MMC_SIGNAL_VOLTAGE_180:
|
case MMC_SIGNAL_VOLTAGE_180:
|
||||||
@ -1756,7 +1756,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
|
|||||||
1700000, 1950000);
|
1700000, 1950000);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_warning("%s: Switching to 1.8V signalling voltage "
|
pr_warning("%s: Switching to 1.8V signalling voltage "
|
||||||
" failed\n", mmc_hostname(host->mmc));
|
" failed\n", mmc_hostname(mmc));
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1774,7 +1774,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pr_warning("%s: 1.8V regulator output did not became stable\n",
|
pr_warning("%s: 1.8V regulator output did not became stable\n",
|
||||||
mmc_hostname(host->mmc));
|
mmc_hostname(mmc));
|
||||||
|
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
case MMC_SIGNAL_VOLTAGE_120:
|
case MMC_SIGNAL_VOLTAGE_120:
|
||||||
@ -1783,7 +1783,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
|
|||||||
1300000);
|
1300000);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_warning("%s: Switching to 1.2V signalling voltage "
|
pr_warning("%s: Switching to 1.2V signalling voltage "
|
||||||
" failed\n", mmc_hostname(host->mmc));
|
" failed\n", mmc_hostname(mmc));
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2822,12 +2822,12 @@ int sdhci_add_host(struct sdhci_host *host)
|
|||||||
* (128) and potentially one alignment transfer for
|
* (128) and potentially one alignment transfer for
|
||||||
* each of those entries.
|
* each of those entries.
|
||||||
*/
|
*/
|
||||||
host->adma_desc = dma_alloc_coherent(mmc_dev(host->mmc),
|
host->adma_desc = dma_alloc_coherent(mmc_dev(mmc),
|
||||||
ADMA_SIZE, &host->adma_addr,
|
ADMA_SIZE, &host->adma_addr,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
host->align_buffer = kmalloc(128 * 4, GFP_KERNEL);
|
host->align_buffer = kmalloc(128 * 4, GFP_KERNEL);
|
||||||
if (!host->adma_desc || !host->align_buffer) {
|
if (!host->adma_desc || !host->align_buffer) {
|
||||||
dma_free_coherent(mmc_dev(host->mmc), ADMA_SIZE,
|
dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
|
||||||
host->adma_desc, host->adma_addr);
|
host->adma_desc, host->adma_addr);
|
||||||
kfree(host->align_buffer);
|
kfree(host->align_buffer);
|
||||||
pr_warning("%s: Unable to allocate ADMA "
|
pr_warning("%s: Unable to allocate ADMA "
|
||||||
@ -2840,7 +2840,7 @@ int sdhci_add_host(struct sdhci_host *host)
|
|||||||
pr_warning("%s: unable to allocate aligned ADMA descriptor\n",
|
pr_warning("%s: unable to allocate aligned ADMA descriptor\n",
|
||||||
mmc_hostname(mmc));
|
mmc_hostname(mmc));
|
||||||
host->flags &= ~SDHCI_USE_ADMA;
|
host->flags &= ~SDHCI_USE_ADMA;
|
||||||
dma_free_coherent(mmc_dev(host->mmc), ADMA_SIZE,
|
dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
|
||||||
host->adma_desc, host->adma_addr);
|
host->adma_desc, host->adma_addr);
|
||||||
kfree(host->align_buffer);
|
kfree(host->align_buffer);
|
||||||
host->adma_desc = NULL;
|
host->adma_desc = NULL;
|
||||||
@ -2855,7 +2855,7 @@ int sdhci_add_host(struct sdhci_host *host)
|
|||||||
*/
|
*/
|
||||||
if (!(host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA))) {
|
if (!(host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA))) {
|
||||||
host->dma_mask = DMA_BIT_MASK(64);
|
host->dma_mask = DMA_BIT_MASK(64);
|
||||||
mmc_dev(host->mmc)->dma_mask = &host->dma_mask;
|
mmc_dev(mmc)->dma_mask = &host->dma_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (host->version >= SDHCI_SPEC_300)
|
if (host->version >= SDHCI_SPEC_300)
|
||||||
@ -2961,7 +2961,7 @@ int sdhci_add_host(struct sdhci_host *host)
|
|||||||
mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
|
mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
|
||||||
|
|
||||||
if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
|
if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
|
||||||
!(host->mmc->caps & MMC_CAP_NONREMOVABLE))
|
!(mmc->caps & MMC_CAP_NONREMOVABLE))
|
||||||
mmc->caps |= MMC_CAP_NEEDS_POLL;
|
mmc->caps |= MMC_CAP_NEEDS_POLL;
|
||||||
|
|
||||||
/* If there are external regulators, get them */
|
/* If there are external regulators, get them */
|
||||||
@ -3258,7 +3258,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
|
|||||||
|
|
||||||
if (host->mrq) {
|
if (host->mrq) {
|
||||||
pr_err("%s: Controller removed during "
|
pr_err("%s: Controller removed during "
|
||||||
" transfer!\n", mmc_hostname(host->mmc));
|
" transfer!\n", mmc_hostname(mmc));
|
||||||
|
|
||||||
host->mrq->cmd->error = -ENOMEDIUM;
|
host->mrq->cmd->error = -ENOMEDIUM;
|
||||||
tasklet_schedule(&host->finish_tasklet);
|
tasklet_schedule(&host->finish_tasklet);
|
||||||
@ -3269,7 +3269,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
|
|||||||
|
|
||||||
sdhci_disable_card_detection(host);
|
sdhci_disable_card_detection(host);
|
||||||
|
|
||||||
mmc_remove_host(host->mmc);
|
mmc_remove_host(mmc);
|
||||||
|
|
||||||
#ifdef SDHCI_USE_LEDS_CLASS
|
#ifdef SDHCI_USE_LEDS_CLASS
|
||||||
led_classdev_unregister(&host->led);
|
led_classdev_unregister(&host->led);
|
||||||
@ -3293,7 +3293,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
|
|||||||
regulator_disable(mmc->supply.vqmmc);
|
regulator_disable(mmc->supply.vqmmc);
|
||||||
|
|
||||||
if (host->adma_desc)
|
if (host->adma_desc)
|
||||||
dma_free_coherent(mmc_dev(host->mmc), ADMA_SIZE,
|
dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
|
||||||
host->adma_desc, host->adma_addr);
|
host->adma_desc, host->adma_addr);
|
||||||
kfree(host->align_buffer);
|
kfree(host->align_buffer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user