diff mbox

[01/10] ARM: change ARM_DMA_ZONE_SIZE into a variable

Message ID 20110709081223.GA30368@n2100.arm.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Russell King - ARM Linux July 9, 2011, 8:12 a.m. UTC
On Fri, Jul 08, 2011 at 09:30:45PM +0100, Russell King - ARM Linux wrote:
> On Fri, Jul 08, 2011 at 01:14:41PM +0100, Russell King - ARM Linux wrote:
> > It looks like ISA_DMA_THRESHOLD has become unused by most of the kernel,
> > so yes, renaming it to "dma_zone_limit" would be more descriptive.  We
> > should probably make dma_supported() be out-of-line anyway (which then
> > means that dma_zone_limit doesn't have to be exported to drivers) - and
> > I think the DMA bounce stuff needs cleaning up in dma_set_mask().
> 
> ... and I now have a patch which does this, pending testing.  Once
> I've tested it I'll send it out.

8<-----
From: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: dmabounce: simplify dma_set_mask()

Simplify the dmabounce specific code in dma_set_mask().  We can just
omit setting the dma mask if dmabounce is enabled (we will have already
set dma mask via callbacks when the device is created in that case.)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/include/asm/dma-mapping.h |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index 4ad2533..94662f4 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -133,18 +133,12 @@  static inline int dma_supported(struct device *dev, u64 mask)
 
 static inline int dma_set_mask(struct device *dev, u64 dma_mask)
 {
-#ifdef CONFIG_DMABOUNCE
-	if (dev->archdata.dmabounce) {
-		if (dma_mask >= ISA_DMA_THRESHOLD)
-			return 0;
-		else
-			return -EIO;
-	}
-#endif
 	if (!dev->dma_mask || !dma_supported(dev, dma_mask))
 		return -EIO;
 
+#ifndef CONFIG_DMABOUNCE
 	*dev->dma_mask = dma_mask;
+#endif
 
 	return 0;
 }