Commit df804d5e authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Ulf Hansson

mmc: omap: Initialize dma_slave_config to avoid random data in it's fields

It is wrong to use uninitialized dma_slave_config and configure only
certain fields as the DMAengine driver might look at non initialized
(random data) fields and tries to interpret it.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent e5789608
...@@ -1016,14 +1016,16 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req) ...@@ -1016,14 +1016,16 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req)
/* Only reconfigure if we have a different burst size */ /* Only reconfigure if we have a different burst size */
if (*bp != burst) { if (*bp != burst) {
struct dma_slave_config cfg; struct dma_slave_config cfg = {
.src_addr = host->phys_base +
cfg.src_addr = host->phys_base + OMAP_MMC_REG(host, DATA); OMAP_MMC_REG(host, DATA),
cfg.dst_addr = host->phys_base + OMAP_MMC_REG(host, DATA); .dst_addr = host->phys_base +
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; OMAP_MMC_REG(host, DATA),
cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; .src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
cfg.src_maxburst = burst; .dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
cfg.dst_maxburst = burst; .src_maxburst = burst,
.dst_maxburst = burst,
};
if (dmaengine_slave_config(c, &cfg)) if (dmaengine_slave_config(c, &cfg))
goto use_pio; goto use_pio;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment