226 if (status) { |
227 if (status) { |
227 pr_warn("read CCAT pci revision failed with %d\n", status); |
228 pr_warn("read CCAT pci revision failed with %d\n", status); |
228 return status; |
229 return status; |
229 } |
230 } |
230 |
231 |
|
232 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) |
231 if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) { |
233 if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) { |
232 pr_debug("64 bit DMA supported, pci rev: %u\n", revision); |
234 pr_debug("64 bit DMA supported, pci rev: %u\n", revision); |
233 } else if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { |
235 } else if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { |
234 pr_debug("32 bit DMA supported, pci rev: %u\n", revision); |
236 pr_debug("32 bit DMA supported, pci rev: %u\n", revision); |
235 } else { |
237 } else { |
236 pr_warn("No suitable DMA available, pci rev: %u\n", revision); |
238 pr_warn("No suitable DMA available, pci rev: %u\n", revision); |
237 } |
239 } |
|
240 #else |
|
241 if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) { |
|
242 pr_debug("64 bit DMA supported, pci rev: %u\n", revision); |
|
243 } else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) { |
|
244 pr_debug("32 bit DMA supported, pci rev: %u\n", revision); |
|
245 } else { |
|
246 pr_warn("No suitable DMA available, pci rev: %u\n", revision); |
|
247 } |
|
248 #endif |
238 |
249 |
239 if (ccat_bar_init(&ccatdev->bar[0], 0, pdev)) { |
250 if (ccat_bar_init(&ccatdev->bar[0], 0, pdev)) { |
240 pr_warn("initialization of bar0 failed.\n"); |
251 pr_warn("initialization of bar0 failed.\n"); |
241 return -EIO; |
252 return -EIO; |
242 } |
253 } |