tg3: Remove define and single use of GET_CHIP_REV_ID
authorJoe Perches <joe@perches.com>
Sat, 16 Feb 2013 11:20:03 +0000 (11:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Feb 2013 17:45:52 +0000 (12:45 -0500)
It's the same value as tp->pci_chip_rev_id so use that
instead.  This makes all CHIPREV_ID_<foo> tests the same.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c
drivers/net/ethernet/broadcom/tg3.h

index 1b5987676f7c1479359458cace4ff3367d878cfa..f511e8b6e7f56ab57f38e5d73bb150d5cb76c674 100644 (file)
@@ -15761,12 +15761,10 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
                              &pci_state_reg);
        if ((pci_state_reg & PCISTATE_CONV_PCI_MODE) == 0 &&
            !tg3_flag(tp, PCIX_TARGET_HWBUG)) {
-               u32 chiprevid = GET_CHIP_REV_ID(tp->misc_host_ctrl);
-
-               if (chiprevid == CHIPREV_ID_5701_A0 ||
-                   chiprevid == CHIPREV_ID_5701_B0 ||
-                   chiprevid == CHIPREV_ID_5701_B2 ||
-                   chiprevid == CHIPREV_ID_5701_B5) {
+               if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 ||
+                   tp->pci_chip_rev_id == CHIPREV_ID_5701_B0 ||
+                   tp->pci_chip_rev_id == CHIPREV_ID_5701_B2 ||
+                   tp->pci_chip_rev_id == CHIPREV_ID_5701_B5) {
                        void __iomem *sram_base;
 
                        /* Write some dummy words into the SRAM status block
index b6767286d23c5a8e33580439020e78dd6fde3a98..3e27f2efbfe0fe3865ef94a781bacdad0ecaa15f 100644 (file)
 #define  MISC_HOST_CTRL_TAGGED_STATUS   0x00000200
 #define  MISC_HOST_CTRL_CHIPREV                 0xffff0000
 #define  MISC_HOST_CTRL_CHIPREV_SHIFT   16
-#define  GET_CHIP_REV_ID(MISC_HOST_CTRL) \
-        (((MISC_HOST_CTRL) & MISC_HOST_CTRL_CHIPREV) >> \
-         MISC_HOST_CTRL_CHIPREV_SHIFT)
+
 #define  CHIPREV_ID_5700_A0             0x7000
 #define  CHIPREV_ID_5700_A1             0x7001
 #define  CHIPREV_ID_5700_B0             0x7100