net/mlx5: Use dma device access helper
[sfrench/cifs-2.6.git] / drivers / net / ethernet / mellanox / mlx5 / core / fpga / conn.c
index 9f6d97eae0ae7a17c17a179b73180c5208eb9070..80da50e1291532e99525ea5da838eedec1f64f2b 100644 (file)
@@ -54,7 +54,7 @@ static int mlx5_fpga_conn_map_buf(struct mlx5_fpga_conn *conn,
        if (unlikely(!buf->sg[0].data))
                goto out;
 
-       dma_device = &conn->fdev->mdev->pdev->dev;
+       dma_device = mlx5_core_dma_dev(conn->fdev->mdev);
        buf->sg[0].dma_addr = dma_map_single(dma_device, buf->sg[0].data,
                                             buf->sg[0].size, buf->dma_dir);
        err = dma_mapping_error(dma_device, buf->sg[0].dma_addr);
@@ -86,7 +86,7 @@ static void mlx5_fpga_conn_unmap_buf(struct mlx5_fpga_conn *conn,
 {
        struct device *dma_device;
 
-       dma_device = &conn->fdev->mdev->pdev->dev;
+       dma_device = mlx5_core_dma_dev(conn->fdev->mdev);
        if (buf->sg[1].data)
                dma_unmap_single(dma_device, buf->sg[1].dma_addr,
                                 buf->sg[1].size, buf->dma_dir);