convert swiotlb to use dma_get_mask
swiotlb can use dma_get_mask() instead of the homegrown function.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: tony.luck@intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 0dba743..ba9114e 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -65,7 +65,7 @@
static inline u64 dma_get_mask(struct device *dev)
{
- if (dev->dma_mask && *dev->dma_mask)
+ if (dev && dev->dma_mask && *dev->dma_mask)
return *dev->dma_mask;
return DMA_32BIT_MASK;
}