Commit e1631f98 authored by Jaehoon Chung's avatar Jaehoon Chung Committed by Chris Ball

mmc: dw_mmc: prevent NULL dereference for dma_ops

Now, dma_ops is assumed that use the IDMAC.  But if dma_ops is assigned
the pdata->dma_ops, we didn't ensure that callback function is defined.

If the callback isn't defined, then we should run in PIO mode.
Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarWill Newton <will.newton@imgtec.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent b8915282
...@@ -1881,7 +1881,8 @@ static void dw_mci_init_dma(struct dw_mci *host) ...@@ -1881,7 +1881,8 @@ static void dw_mci_init_dma(struct dw_mci *host)
if (!host->dma_ops) if (!host->dma_ops)
goto no_dma; goto no_dma;
if (host->dma_ops->init) { if (host->dma_ops->init && host->dma_ops->start &&
host->dma_ops->stop && host->dma_ops->cleanup) {
if (host->dma_ops->init(host)) { if (host->dma_ops->init(host)) {
dev_err(&host->dev, "%s: Unable to initialize " dev_err(&host->dev, "%s: Unable to initialize "
"DMA Controller.\n", __func__); "DMA Controller.\n", __func__);
......
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