From: Andy Shevchenko Date: Thu, 14 Feb 2013 08:41:09 +0000 (+0200) Subject: dw_dmac: apply default dma_mask if needed X-Git-Tag: upstream/snapshot3+hdmi~5581^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=877e86f28385407f05c5aa4e397d4ccb3233f01a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git dw_dmac: apply default dma_mask if needed In some cases we got the device without dma_mask configured. We have to apply the default value to avoid crashes during memory mapping. Signed-off-by: Andy Shevchenko Acked-by: Viresh Kumar Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 6694676..4c83f18 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c @@ -1661,6 +1661,12 @@ static int dw_probe(struct platform_device *pdev) if (!regs) return -EBUSY; + /* Apply default dma_mask if needed */ + if (!pdev->dev.dma_mask) { + pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; + pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + } + dw_params = dma_read_byaddr(regs, DW_PARAMS); autocfg = dw_params >> DW_PARAMS_EN & 0x1;