Commit 32e8f702 authored by James Bottomley's avatar James Bottomley Committed by Linus Torvalds

introduce DMA_MASK_NONE as a signal for unable to do DMA

Some devices are incapable of DMA and need to be recognised as such.
Introduce a NONE dma mask to facilitate this plus an inline function:
is_device_dma_capable() to check this.
Signed-off-by: default avatarJames Bottomley <>
Cc: Andi Kleen <>
Cc: Alan Cox <>
Cc: Tejun Heo <>
Cc: Natalie Protasevich <>
Cc: Jeff Garzik <>
Cc: Dominik Brodowski <>
Cc: Russell King <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 64da82ef
......@@ -24,6 +24,8 @@ enum dma_data_direction {
#define DMA_28BIT_MASK 0x000000000fffffffULL
#define DMA_24BIT_MASK 0x0000000000ffffffULL
#define DMA_MASK_NONE 0x0ULL
static inline int valid_dma_direction(int dma_direction)
return ((dma_direction == DMA_BIDIRECTIONAL) ||
......@@ -31,6 +33,11 @@ static inline int valid_dma_direction(int dma_direction)
(dma_direction == DMA_FROM_DEVICE));
static inline int is_device_dma_capable(struct device *dev)
return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE;
#include <asm/dma-mapping.h>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment