net/mlx4: replace pci_{,un}map_sg with dma_{,un}map_sg
pci_{,un}map_sg are deprecated and replaced by dma_{,un}map_sg. This is especially relevant since the rest of the driver uses the DMA API. Fix the driver to use the replacement APIs. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f65e192af3
commit
01cd364a15
|
@ -57,8 +57,8 @@ static void mlx4_free_icm_pages(struct mlx4_dev *dev, struct mlx4_icm_chunk *chu
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (chunk->nsg > 0)
|
if (chunk->nsg > 0)
|
||||||
pci_unmap_sg(dev->persist->pdev, chunk->sg, chunk->npages,
|
dma_unmap_sg(&dev->persist->pdev->dev, chunk->sg, chunk->npages,
|
||||||
PCI_DMA_BIDIRECTIONAL);
|
DMA_BIDIRECTIONAL);
|
||||||
|
|
||||||
for (i = 0; i < chunk->npages; ++i)
|
for (i = 0; i < chunk->npages; ++i)
|
||||||
__free_pages(sg_page(&chunk->sg[i]),
|
__free_pages(sg_page(&chunk->sg[i]),
|
||||||
|
@ -204,9 +204,9 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages,
|
||||||
if (coherent)
|
if (coherent)
|
||||||
++chunk->nsg;
|
++chunk->nsg;
|
||||||
else if (chunk->npages == MLX4_ICM_CHUNK_LEN) {
|
else if (chunk->npages == MLX4_ICM_CHUNK_LEN) {
|
||||||
chunk->nsg = pci_map_sg(dev->persist->pdev, chunk->sg,
|
chunk->nsg = dma_map_sg(&dev->persist->pdev->dev,
|
||||||
chunk->npages,
|
chunk->sg, chunk->npages,
|
||||||
PCI_DMA_BIDIRECTIONAL);
|
DMA_BIDIRECTIONAL);
|
||||||
|
|
||||||
if (chunk->nsg <= 0)
|
if (chunk->nsg <= 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -219,9 +219,8 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!coherent && chunk) {
|
if (!coherent && chunk) {
|
||||||
chunk->nsg = pci_map_sg(dev->persist->pdev, chunk->sg,
|
chunk->nsg = dma_map_sg(&dev->persist->pdev->dev, chunk->sg,
|
||||||
chunk->npages,
|
chunk->npages, DMA_BIDIRECTIONAL);
|
||||||
PCI_DMA_BIDIRECTIONAL);
|
|
||||||
|
|
||||||
if (chunk->nsg <= 0)
|
if (chunk->nsg <= 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
Loading…
Reference in New Issue