diff options
Diffstat (limited to 'arch/tile/kernel/pci-dma.c')
-rw-r--r-- | arch/tile/kernel/pci-dma.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/tile/kernel/pci-dma.c b/arch/tile/kernel/pci-dma.c index 7e22e73264a9..adc369d8c77b 100644 --- a/arch/tile/kernel/pci-dma.c +++ b/arch/tile/kernel/pci-dma.c | |||
@@ -36,8 +36,9 @@ static void *tile_dma_alloc_coherent(struct device *dev, size_t size, | |||
36 | dma_addr_t *dma_handle, gfp_t gfp, | 36 | dma_addr_t *dma_handle, gfp_t gfp, |
37 | struct dma_attrs *attrs) | 37 | struct dma_attrs *attrs) |
38 | { | 38 | { |
39 | u64 dma_mask = dev->coherent_dma_mask ?: DMA_BIT_MASK(32); | 39 | u64 dma_mask = (dev && dev->coherent_dma_mask) ? |
40 | int node = dev_to_node(dev); | 40 | dev->coherent_dma_mask : DMA_BIT_MASK(32); |
41 | int node = dev ? dev_to_node(dev) : 0; | ||
41 | int order = get_order(size); | 42 | int order = get_order(size); |
42 | struct page *pg; | 43 | struct page *pg; |
43 | dma_addr_t addr; | 44 | dma_addr_t addr; |