Skip to content

Commit 0589342

Browse files
author
Rob Herring
committed
of: set dma_mask to point to coherent_dma_mask
Platform devices created by DT code don't initialize dma_mask pointer to anything. Set it to coherent_dma_mask by default if the architecture code has not set it. Signed-off-by: Rob Herring <[email protected]>
1 parent 13ccacd commit 0589342

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/of/platform.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ static struct platform_device *of_platform_device_create_pdata(
216216
dev->archdata.dma_mask = 0xffffffffUL;
217217
#endif
218218
dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
219+
if (!dev->dev.dma_mask)
220+
dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
219221
dev->dev.bus = &platform_bus_type;
220222
dev->dev.platform_data = platform_data;
221223

0 commit comments

Comments
 (0)