buf_virt = gen_pool_dma_alloc(sdma->iram_pool, size, &buf_phys);
if (!buf_virt) {
use_iram = false;
- buf_virt = dma_alloc_coherent(NULL, size, &buf_phys, GFP_KERNEL);
+ buf_virt = dma_alloc_coherent(sdma->dev, size, &buf_phys, GFP_KERNEL);
if (!buf_virt)
return -ENOMEM;
}
if (use_iram)
gen_pool_free(sdma->iram_pool, (unsigned long)buf_virt, size);
else
- dma_free_coherent(NULL, size, buf_virt, buf_phys);
+ dma_free_coherent(sdma->dev, size, buf_virt, buf_phys);
return ret;
}
&desc->bd_phys);
if (!desc->bd) {
desc->bd_iram = false;
- desc->bd = dma_alloc_coherent(NULL, bd_size, &desc->bd_phys, GFP_ATOMIC);
+ desc->bd = dma_alloc_coherent(desc->sdmac->sdma->dev, bd_size,
+ &desc->bd_phys, GFP_ATOMIC);
if (!desc->bd)
return ret;
}
gen_pool_free(desc->sdmac->sdma->iram_pool,
(unsigned long)desc->bd, bd_size);
else
- dma_free_coherent(NULL, bd_size, desc->bd,
- desc->bd_phys);
+ dma_free_coherent(desc->sdmac->sdma->dev, bd_size,
+ desc->bd, desc->bd_phys);
spin_lock_irqsave(&desc->sdmac->vc.lock, flags);
desc->sdmac->bd_size_sum -= bd_size;
spin_unlock_irqrestore(&desc->sdmac->vc.lock, flags);
sdma->bd0 = gen_pool_dma_alloc(sdma->iram_pool, PAGE_SIZE, &sdma->bd0_phys);
if (!sdma->bd0) {
sdma->bd0_iram = false;
- sdma->bd0 = dma_alloc_coherent(NULL, PAGE_SIZE, &sdma->bd0_phys, GFP_KERNEL);
+ sdma->bd0 = dma_alloc_coherent(sdma->dev, PAGE_SIZE,
+ &sdma->bd0_phys, GFP_KERNEL);
if (!sdma->bd0) {
ret = -ENOMEM;
goto out;
sdma->channel_control = gen_pool_dma_alloc(sdma->iram_pool, ccbsize, &ccb_phys);
if (!sdma->channel_control) {
- sdma->channel_control = dma_alloc_coherent(NULL, ccbsize,
+ sdma->channel_control = dma_alloc_coherent(sdma->dev, ccbsize,
&ccb_phys, GFP_KERNEL);
if (!sdma->channel_control) {
ret = -ENOMEM;