Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: tmio, renesas_sdhi: move Renesas-specific DMA data to renesas_sdhi.h

struct tmio_mmc_host has "dma_dataend" and "dma_complete", but in fact,
they are Renesas private data. Move them to renesas_sdhi.h

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Masahiro Yamada and committed by
Ulf Hansson
90d95106 058db286

+18 -9
+2
drivers/mmc/host/renesas_sdhi.h
··· 39 39 enum dma_slave_buswidth dma_buswidth; 40 40 bool (*filter)(struct dma_chan *chan, void *arg); 41 41 void (*enable)(struct tmio_mmc_host *host, bool enable); 42 + struct completion dma_dataend; 43 + struct tasklet_struct dma_complete; 42 44 }; 43 45 44 46 struct renesas_sdhi {
+6 -2
drivers/mmc/host/renesas_sdhi_internal_dmac.c
··· 132 132 133 133 static void 134 134 renesas_sdhi_internal_dmac_dataend_dma(struct tmio_mmc_host *host) { 135 - tasklet_schedule(&host->dma_complete); 135 + struct renesas_sdhi *priv = host_to_priv(host); 136 + 137 + tasklet_schedule(&priv->dma_priv.dma_complete); 136 138 } 137 139 138 140 static void ··· 224 222 renesas_sdhi_internal_dmac_request_dma(struct tmio_mmc_host *host, 225 223 struct tmio_mmc_data *pdata) 226 224 { 225 + struct renesas_sdhi *priv = host_to_priv(host); 226 + 227 227 /* Each value is set to non-zero to assume "enabling" each DMA */ 228 228 host->chan_rx = host->chan_tx = (void *)0xdeadbeaf; 229 229 230 - tasklet_init(&host->dma_complete, 230 + tasklet_init(&priv->dma_priv.dma_complete, 231 231 renesas_sdhi_internal_dmac_complete_tasklet_fn, 232 232 (unsigned long)host); 233 233 tasklet_init(&host->dma_issue,
+10 -5
drivers/mmc/host/renesas_sdhi_sys_dmac.c
··· 140 140 141 141 static void renesas_sdhi_sys_dmac_dataend_dma(struct tmio_mmc_host *host) 142 142 { 143 - complete(&host->dma_dataend); 143 + struct renesas_sdhi *priv = host_to_priv(host); 144 + 145 + complete(&priv->dma_priv.dma_dataend); 144 146 } 145 147 146 148 static void renesas_sdhi_sys_dmac_dma_callback(void *arg) 147 149 { 148 150 struct tmio_mmc_host *host = arg; 151 + struct renesas_sdhi *priv = host_to_priv(host); 149 152 150 153 spin_lock_irq(&host->lock); 151 154 ··· 166 163 167 164 spin_unlock_irq(&host->lock); 168 165 169 - wait_for_completion(&host->dma_dataend); 166 + wait_for_completion(&priv->dma_priv.dma_dataend); 170 167 171 168 spin_lock_irq(&host->lock); 172 169 tmio_mmc_do_data_irq(host); ··· 176 173 177 174 static void renesas_sdhi_sys_dmac_start_dma_rx(struct tmio_mmc_host *host) 178 175 { 176 + struct renesas_sdhi *priv = host_to_priv(host); 179 177 struct scatterlist *sg = host->sg_ptr, *sg_tmp; 180 178 struct dma_async_tx_descriptor *desc = NULL; 181 179 struct dma_chan *chan = host->chan_rx; ··· 220 216 DMA_CTRL_ACK); 221 217 222 218 if (desc) { 223 - reinit_completion(&host->dma_dataend); 219 + reinit_completion(&priv->dma_priv.dma_dataend); 224 220 desc->callback = renesas_sdhi_sys_dmac_dma_callback; 225 221 desc->callback_param = host; 226 222 ··· 251 247 252 248 static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host) 253 249 { 250 + struct renesas_sdhi *priv = host_to_priv(host); 254 251 struct scatterlist *sg = host->sg_ptr, *sg_tmp; 255 252 struct dma_async_tx_descriptor *desc = NULL; 256 253 struct dma_chan *chan = host->chan_tx; ··· 300 295 DMA_CTRL_ACK); 301 296 302 297 if (desc) { 303 - reinit_completion(&host->dma_dataend); 298 + reinit_completion(&priv->dma_priv.dma_dataend); 304 299 desc->callback = renesas_sdhi_sys_dmac_dma_callback; 305 300 desc->callback_param = host; 306 301 ··· 429 424 if (!host->bounce_buf) 430 425 goto ebouncebuf; 431 426 432 - init_completion(&host->dma_dataend); 427 + init_completion(&priv->dma_priv.dma_dataend); 433 428 tasklet_init(&host->dma_issue, 434 429 renesas_sdhi_sys_dmac_issue_tasklet_fn, 435 430 (unsigned long)host);
-2
drivers/mmc/host/tmio_mmc.h
··· 148 148 bool force_pio; 149 149 struct dma_chan *chan_rx; 150 150 struct dma_chan *chan_tx; 151 - struct completion dma_dataend; 152 - struct tasklet_struct dma_complete; 153 151 struct tasklet_struct dma_issue; 154 152 struct scatterlist bounce_sg; 155 153 u8 *bounce_buf;