TI DaVinci EMAC: Fix incorrect reference to EMAC_CTRL registers.
authorSriram <srk@ti.com>
Thu, 29 Jul 2010 02:34:00 +0000 (02:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 31 Jul 2010 06:55:37 +0000 (23:55 -0700)
The EMAC modules control registers vary as per the version of the
EMAC module. EMAC_CTRL_EWCTL,EMAC_CTRL_EWINTTCNT are available
only on EMAC_VERSION_1. The emac_dump_regs() function accesses
these indiscriminately. This patch fixes the issue.

Signed-off-by: Sriramakrishnan <srk@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/davinci_emac.c

index 2ebf1a1dd1e1fafba73a892291f71f58a3d8cc13..2fe709f98cc4a77bc4be8f251640864b18718e74 100644 (file)
@@ -564,9 +564,11 @@ static void emac_dump_regs(struct emac_priv *priv)
 
        /* Print important registers in EMAC */
        dev_info(emac_dev, "EMAC Basic registers\n");
-       dev_info(emac_dev, "EMAC: EWCTL: %08X, EWINTTCNT: %08X\n",
-               emac_ctrl_read(EMAC_CTRL_EWCTL),
-               emac_ctrl_read(EMAC_CTRL_EWINTTCNT));
+       if (priv->version == EMAC_VERSION_1) {
+               dev_info(emac_dev, "EMAC: EWCTL: %08X, EWINTTCNT: %08X\n",
+                       emac_ctrl_read(EMAC_CTRL_EWCTL),
+                       emac_ctrl_read(EMAC_CTRL_EWINTTCNT));
+       }
        dev_info(emac_dev, "EMAC: TXID: %08X %s, RXID: %08X %s\n",
                emac_read(EMAC_TXIDVER),
                ((emac_read(EMAC_TXCONTROL)) ? "enabled" : "disabled"),