summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/uar.c
diff options
context:
space:
mode:
authorHuy Nguyen <huyn@mellanox.com>2019-03-29 15:38:01 -0700
committerSaeed Mahameed <saeedm@mellanox.com>2019-04-02 12:49:38 -0700
commitaa8106f137b93628d531ef5ecbbcbecef99370d7 (patch)
treeaf753263dd0f2d44ab4ae117ff33ff7659a3dda0 /drivers/net/ethernet/mellanox/mlx5/core/uar.c
parent98a8e6fc482d96809d90fcab661835ed299359c5 (diff)
downloadlinux-aa8106f137b93628d531ef5ecbbcbecef99370d7.tar.bz2
net/mlx5: Add explicit bar address field
Add bar_addr field to store bar-0 address to avoid calling pci_resource_start with hard-coded bar-0 as parameter. Also note that different mlx5 device types will have bar_addr on different bars. This patch does not change any functionality. Signed-off-by: Huy Nguyen <huyn@mellanox.com> Signed-off-by: Vu Pham <vuhuong@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/uar.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/uar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/uar.c b/drivers/net/ethernet/mellanox/mlx5/core/uar.c
index 8b97066dd1f1..b7d52709b8b1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/uar.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/uar.c
@@ -79,7 +79,7 @@ static u64 uar2pfn(struct mlx5_core_dev *mdev, u32 index)
else
system_page_index = index;
- return (pci_resource_start(mdev->pdev, 0) >> PAGE_SHIFT) + system_page_index;
+ return (mdev->bar_addr >> PAGE_SHIFT) + system_page_index;
}
static void up_rel_func(struct kref *kref)