Skip to content

Commit

Permalink
TI DaVinci EMAC: Fix incorrect reference to EMAC_CTRL registers.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sriram authored and David S. Miller committed Jul 31, 2010
1 parent 3725b1f commit e994762
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/davinci_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit e994762

Please sign in to comment.