sglen = dma_map_sg(chan->device->dev, data->sg,
data->sg_len, direction);
- if (sglen != data->sg_len)
- goto unmap_exit;
+
desc = chan->device->device_prep_slave_sg(chan,
- data->sg, data->sg_len, direction,
+ data->sg, sglen, direction,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!desc)
goto unmap_exit;
return 0;
unmap_exit:
- dma_unmap_sg(chan->device->dev, data->sg, sglen, direction);
+ dma_unmap_sg(chan->device->dev, data->sg, data->sg_len, direction);
return -ENOMEM;
}