diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2018-05-17 06:07:13 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2018-05-31 03:02:21 -0400 |
commit | b12c8a70643ffe2598c572cd206e4f68c524eb6f (patch) | |
tree | 551cc2b429bc08d3827de079239a91ca6a5a49e1 | |
parent | 3f90f9ef2dda316d64e420d5d51ba369587ccc55 (diff) |
m68k: Set default dma mask for platform devices
This avoids a WARNING splat when loading the macsonic or macmace driver.
Please see commit 205e1b7f51e4 ("dma-mapping: warn when there is no
coherent_dma_mask").
This implementation of arch_setup_pdev_archdata() differs from the
powerpc one, in that this one avoids clobbering a device dma mask
which has already been initialized.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r-- | arch/m68k/kernel/dma.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c index c01b9b8f97bf..463572c4943f 100644 --- a/arch/m68k/kernel/dma.c +++ b/arch/m68k/kernel/dma.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/dma-mapping.h> | 9 | #include <linux/dma-mapping.h> |
10 | #include <linux/device.h> | 10 | #include <linux/device.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/platform_device.h> | ||
12 | #include <linux/scatterlist.h> | 13 | #include <linux/scatterlist.h> |
13 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
14 | #include <linux/vmalloc.h> | 15 | #include <linux/vmalloc.h> |
@@ -165,3 +166,12 @@ const struct dma_map_ops m68k_dma_ops = { | |||
165 | .sync_sg_for_device = m68k_dma_sync_sg_for_device, | 166 | .sync_sg_for_device = m68k_dma_sync_sg_for_device, |
166 | }; | 167 | }; |
167 | EXPORT_SYMBOL(m68k_dma_ops); | 168 | EXPORT_SYMBOL(m68k_dma_ops); |
169 | |||
170 | void arch_setup_pdev_archdata(struct platform_device *pdev) | ||
171 | { | ||
172 | if (pdev->dev.coherent_dma_mask == DMA_MASK_NONE && | ||
173 | pdev->dev.dma_mask == NULL) { | ||
174 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
175 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
176 | } | ||
177 | } | ||