diff options
author | Jisheng Zhang <Jisheng.Zhang@synaptics.com> | 2021-03-24 15:50:13 +0800 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2021-03-30 11:42:07 +0200 |
commit | bac53336ca816624581a3de5f2c0991343ae5341 (patch) | |
tree | 364714bd0008d8b2f8f5c33aa6af10dafd851e8f /drivers/mmc/host/sdhci.c | |
parent | 57ac3084f598d238ae829d595bfc20afaf0feb38 (diff) |
mmc: sdhci: replace mmc->parent with mmc_dev() for consistency
As pointed out by Ulf, "both "mmc->parent" and mmc_dev(mmc) are being
used in the entire c-file". Convert all the mmc->parent usage in all
sdhci host driver to mmc_dev() for consistency.
Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/20210324155013.1e5faa3c@xhacker.debian
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index aefd0441658c..bf238ade1602 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -188,7 +188,7 @@ static void sdhci_runtime_pm_bus_on(struct sdhci_host *host) if (host->bus_on) return; host->bus_on = true; - pm_runtime_get_noresume(host->mmc->parent); + pm_runtime_get_noresume(mmc_dev(host->mmc)); } static void sdhci_runtime_pm_bus_off(struct sdhci_host *host) @@ -196,7 +196,7 @@ static void sdhci_runtime_pm_bus_off(struct sdhci_host *host) if (!host->bus_on) return; host->bus_on = false; - pm_runtime_put_noidle(host->mmc->parent); + pm_runtime_put_noidle(mmc_dev(host->mmc)); } void sdhci_reset(struct sdhci_host *host, u8 mask) @@ -648,7 +648,7 @@ static int sdhci_pre_dma_transfer(struct sdhci_host *host, } } /* Switch ownership to the DMA */ - dma_sync_single_for_device(host->mmc->parent, + dma_sync_single_for_device(mmc_dev(host->mmc), host->bounce_addr, host->bounce_buffer_size, mmc_get_dma_dir(data)); @@ -1176,7 +1176,7 @@ static int sdhci_external_dma_init(struct sdhci_host *host) int ret = 0; struct mmc_host *mmc = host->mmc; - host->tx_chan = dma_request_chan(mmc->parent, "tx"); + host->tx_chan = dma_request_chan(mmc_dev(mmc), "tx"); if (IS_ERR(host->tx_chan)) { ret = PTR_ERR(host->tx_chan); if (ret != -EPROBE_DEFER) @@ -1185,7 +1185,7 @@ static int sdhci_external_dma_init(struct sdhci_host *host) return ret; } - host->rx_chan = dma_request_chan(mmc->parent, "rx"); + host->rx_chan = dma_request_chan(mmc_dev(mmc), "rx"); if (IS_ERR(host->rx_chan)) { if (host->tx_chan) { dma_release_channel(host->tx_chan); @@ -2489,14 +2489,14 @@ void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) unsigned long flags; if (enable) - pm_runtime_get_noresume(mmc->parent); + pm_runtime_get_noresume(mmc_dev(mmc)); spin_lock_irqsave(&host->lock, flags); sdhci_enable_sdio_irq_nolock(host, enable); spin_unlock_irqrestore(&host->lock, flags); if (!enable) - pm_runtime_put_noidle(mmc->parent); + pm_runtime_put_noidle(mmc_dev(mmc)); } EXPORT_SYMBOL_GPL(sdhci_enable_sdio_irq); @@ -3063,7 +3063,7 @@ static bool sdhci_request_done(struct sdhci_host *host) length = host->bounce_buffer_size; } dma_sync_single_for_cpu( - host->mmc->parent, + mmc_dev(host->mmc), host->bounce_addr, host->bounce_buffer_size, DMA_FROM_DEVICE); @@ -3074,7 +3074,7 @@ static bool sdhci_request_done(struct sdhci_host *host) } else { /* No copying, just switch ownership */ dma_sync_single_for_cpu( - host->mmc->parent, + mmc_dev(host->mmc), host->bounce_addr, host->bounce_buffer_size, mmc_get_dma_dir(data)); @@ -4053,7 +4053,7 @@ static void sdhci_allocate_bounce_buffer(struct sdhci_host *host) * speedups by the help of a bounce buffer to group scattered * reads/writes together. */ - host->bounce_buffer = devm_kmalloc(mmc->parent, + host->bounce_buffer = devm_kmalloc(mmc_dev(mmc), bounce_size, GFP_KERNEL); if (!host->bounce_buffer) { @@ -4067,11 +4067,11 @@ static void sdhci_allocate_bounce_buffer(struct sdhci_host *host) return; } - host->bounce_addr = dma_map_single(mmc->parent, + host->bounce_addr = dma_map_single(mmc_dev(mmc), host->bounce_buffer, bounce_size, DMA_BIDIRECTIONAL); - ret = dma_mapping_error(mmc->parent, host->bounce_addr); + ret = dma_mapping_error(mmc_dev(mmc), host->bounce_addr); if (ret) /* Again fall back to max_segs == 1 */ return; |