Skip to content

Commit a551621

Browse files
rmurphy-armChristoph Hellwig
authored andcommitted
of/platform: Initialise default DMA masks
When of_dma_configure() was first born in 591c1ee ("of: configure the platform device dma parameters"), everything DMA-related was factored out of of_platform_device_create_pdata() as seemed appropriate at the time. However, now that of_dma_configure() has grown into the generic handler for processing DMA-related properties from DT for all kinds of devices, it is no longer an appropriate place to be doing OF-platform-specific business. Since there are still plenty of platform drivers not setting their own masks and depending on the bus default, let's reinstate that inialisation in the OF-platform code itself, and restore the long-standing status quo from 0589342 ("of: set dma_mask to point to coherent_dma_mask") Signed-off-by: Robin Murphy <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 25622e0 commit a551621

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/of/platform.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ static struct platform_device *of_platform_device_create_pdata(
185185
if (!dev)
186186
goto err_clear_flag;
187187

188+
dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
189+
if (!dev->dev.dma_mask)
190+
dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
188191
dev->dev.bus = &platform_bus_type;
189192
dev->dev.platform_data = platform_data;
190193
of_msi_configure(&dev->dev, dev->dev.of_node);

0 commit comments

Comments
 (0)