aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-06-10 13:41:59 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-10-31 10:49:07 -0400
commitd6cfaaba1a93a239b01bc8d1351685773b657b64 (patch)
tree5ad0a92b7cf37837fd62f2028cf1fcb646e5876f
parent4cdbb4ff7fe456c43e9d6c6397e37380ff292520 (diff)
DMA-API: others: 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/ata/pata_ixp4xx_cf.c5
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.c6
-rw-r--r--drivers/gpu/drm/omapdrm/omap_dmm_tiler.c5
3 files changed, 12 insertions, 4 deletions
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 1ec53f8ca96f..ddf470c2341d 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -144,6 +144,7 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
144 struct ata_host *host; 144 struct ata_host *host;
145 struct ata_port *ap; 145 struct ata_port *ap;
146 struct ixp4xx_pata_data *data = dev_get_platdata(&pdev->dev); 146 struct ixp4xx_pata_data *data = dev_get_platdata(&pdev->dev);
147 int ret;
147 148
148 cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0); 149 cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
149 cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); 150 cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -157,7 +158,9 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
157 return -ENOMEM; 158 return -ENOMEM;
158 159
159 /* acquire resources and fill host */ 160 /* acquire resources and fill host */
160 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 161 ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
162 if (ret)
163 return ret;
161 164
162 data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000); 165 data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000);
163 data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000); 166 data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index bb82ef78ca85..81192d00b39e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -286,7 +286,11 @@ static struct drm_driver exynos_drm_driver = {
286 286
287static int exynos_drm_platform_probe(struct platform_device *pdev) 287static int exynos_drm_platform_probe(struct platform_device *pdev)
288{ 288{
289 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 289 int ret;
290
291 ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
292 if (ret)
293 return ret;
290 294
291 return drm_platform_init(&exynos_drm_driver, pdev); 295 return drm_platform_init(&exynos_drm_driver, pdev);
292} 296}
diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index acf667859cb6..701c4c10e08b 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -664,8 +664,9 @@ static int omap_dmm_probe(struct platform_device *dev)
664 } 664 }
665 665
666 /* set dma mask for device */ 666 /* set dma mask for device */
667 /* NOTE: this is a workaround for the hwmod not initializing properly */ 667 ret = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
668 dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 668 if (ret)
669 goto fail;
669 670
670 omap_dmm->dummy_pa = page_to_phys(omap_dmm->dummy_page); 671 omap_dmm->dummy_pa = page_to_phys(omap_dmm->dummy_page);
671 672