Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+12 -4
+4 -1
drivers/ata/pata_ixp4xx_cf.c
··· 144 144 struct ata_host *host; 145 145 struct ata_port *ap; 146 146 struct ixp4xx_pata_data *data = dev_get_platdata(&pdev->dev); 147 + int ret; 147 148 148 149 cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0); 149 150 cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); ··· 158 157 return -ENOMEM; 159 158 160 159 /* acquire resources and fill host */ 161 - pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 160 + ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); 161 + if (ret) 162 + return ret; 162 163 163 164 data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000); 164 165 data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000);
+5 -1
drivers/gpu/drm/exynos/exynos_drm_drv.c
··· 286 286 287 287 static 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 295 return drm_platform_init(&exynos_drm_driver, pdev); 292 296 }
+3 -2
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
··· 664 664 } 665 665 666 666 /* set dma mask for device */ 667 - /* NOTE: this is a workaround for the hwmod not initializing properly */ 668 - dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 667 + ret = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32)); 668 + if (ret) 669 + goto fail; 669 670 670 671 omap_dmm->dummy_pa = page_to_phys(omap_dmm->dummy_page); 671 672