aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-06-10 11:56:16 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-10-31 10:49:06 -0400
commit4cdbb4ff7fe456c43e9d6c6397e37380ff292520 (patch)
tree6d27e0e1ee944715fbc38d90c45a43c65799c8e5
parente1fd7341837238c6c5380c5073887d238f706cf0 (diff)
DMA-API: staging: use dma_set_coherent_mask()
The correct way for a driver to specify the coherent DMA mask is not to directly access the field in the struct device, but to use dma_set_coherent_mask(). Only arch and bus code should access this member directly. Convert all direct write accesses to using the correct API. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/staging/dwc2/platform.c5
-rw-r--r--drivers/staging/imx-drm/imx-drm-core.c8
-rw-r--r--drivers/staging/imx-drm/ipuv3-crtc.c4
3 files changed, 12 insertions, 5 deletions
diff --git a/drivers/staging/dwc2/platform.c b/drivers/staging/dwc2/platform.c
index 44cce2fa6361..1d68c49afabe 100644
--- a/drivers/staging/dwc2/platform.c
+++ b/drivers/staging/dwc2/platform.c
@@ -100,8 +100,9 @@ static int dwc2_driver_probe(struct platform_device *dev)
100 */ 100 */
101 if (!dev->dev.dma_mask) 101 if (!dev->dev.dma_mask)
102 dev->dev.dma_mask = &dev->dev.coherent_dma_mask; 102 dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
103 if (!dev->dev.coherent_dma_mask) 103 retval = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
104 dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 104 if (retval)
105 return retval;
105 106
106 irq = platform_get_irq(dev, 0); 107 irq = platform_get_irq(dev, 0);
107 if (irq < 0) { 108 if (irq < 0) {
diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c
index 47c5888461ff..847f430168d5 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -805,6 +805,12 @@ static struct drm_driver imx_drm_driver = {
805 805
806static int imx_drm_platform_probe(struct platform_device *pdev) 806static int imx_drm_platform_probe(struct platform_device *pdev)
807{ 807{
808 int ret;
809
810 ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
811 if (ret)
812 return ret;
813
808 imx_drm_device->dev = &pdev->dev; 814 imx_drm_device->dev = &pdev->dev;
809 815
810 return drm_platform_init(&imx_drm_driver, pdev); 816 return drm_platform_init(&imx_drm_driver, pdev);
@@ -847,8 +853,6 @@ static int __init imx_drm_init(void)
847 goto err_pdev; 853 goto err_pdev;
848 } 854 }
849 855
850 imx_drm_pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32),
851
852 ret = platform_driver_register(&imx_drm_pdrv); 856 ret = platform_driver_register(&imx_drm_pdrv);
853 if (ret) 857 if (ret)
854 goto err_pdrv; 858 goto err_pdrv;
diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c
index 6fd37a7453e9..9e73e8d8c9aa 100644
--- a/drivers/staging/imx-drm/ipuv3-crtc.c
+++ b/drivers/staging/imx-drm/ipuv3-crtc.c
@@ -523,7 +523,9 @@ static int ipu_drm_probe(struct platform_device *pdev)
523 if (!pdata) 523 if (!pdata)
524 return -EINVAL; 524 return -EINVAL;
525 525
526 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 526 ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
527 if (ret)
528 return ret;
527 529
528 ipu_crtc = devm_kzalloc(&pdev->dev, sizeof(*ipu_crtc), GFP_KERNEL); 530 ipu_crtc = devm_kzalloc(&pdev->dev, sizeof(*ipu_crtc), GFP_KERNEL);
529 if (!ipu_crtc) 531 if (!ipu_crtc)