aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cavium/thunder/nic_main.c
diff options
context:
space:
mode:
authorRobert Richter <rrichter@cavium.com>2015-06-02 11:00:18 -0700
committerDavid S. Miller <davem@davemloft.net>2015-06-02 12:49:26 -0700
commitd768b678a8d9c572ad3c2c6ba71d9e7029b867a2 (patch)
treee8c5f6e3226756e0e69c1001bb8090f14e4ca22b /drivers/net/ethernet/cavium/thunder/nic_main.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff)
downloadlinux-dev-d768b678a8d9c572ad3c2c6ba71d9e7029b867a2.tar.xz
linux-dev-d768b678a8d9c572ad3c2c6ba71d9e7029b867a2.zip
net: thunderx: Cleanup duplicate NODE_ID macros, add nic_get_node_id()
There are duplicate NODE_ID macro definitions. Move all of them to nic.h for usage in nic and bgx driver and introduce nic_get_node_id() helper function. This patch also fixes 64bit mask which should have been ULL by reworking the node calculation. Signed-off-by: Robert Richter <rrichter@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/thunder/nic_main.c')
-rw-r--r--drivers/net/ethernet/cavium/thunder/nic_main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nic_main.c b/drivers/net/ethernet/cavium/thunder/nic_main.c
index 0f1f58b54bf1..3ca7ad882c10 100644
--- a/drivers/net/ethernet/cavium/thunder/nic_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nic_main.c
@@ -23,8 +23,6 @@
struct nicpf {
struct pci_dev *pdev;
u8 rev_id;
-#define NIC_NODE_ID_MASK 0x300000000000
-#define NIC_NODE_ID(x) ((x & NODE_ID_MASK) >> 44)
u8 node;
unsigned int flags;
u8 num_vf_en; /* No of VF enabled */
@@ -851,7 +849,7 @@ static int nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_read_config_byte(pdev, PCI_REVISION_ID, &nic->rev_id);
- nic->node = NIC_NODE_ID(pci_resource_start(pdev, PCI_CFG_REG_BAR_NUM));
+ nic->node = nic_get_node_id(pdev);
nic_set_lmac_vf_mapping(nic);