Skip to content

Commit

Permalink
au1000_eth: fix invalid address accessing the MAC enable register
Browse files Browse the repository at this point in the history
"aup->enable" holds already the address pointing to the MAC enable
register. The bug was introduced by commit d0e7cb:

"au1000-eth: remove volatiles, switch to I/O accessors".

CC: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
grandwolf authored and davem330 committed Nov 28, 2010
1 parent 0ac7887 commit 462ca99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/au1000_eth.c
Expand Up @@ -155,10 +155,10 @@ static void au1000_enable_mac(struct net_device *dev, int force_reset)
spin_lock_irqsave(&aup->lock, flags);

if (force_reset || (!aup->mac_enabled)) {
writel(MAC_EN_CLOCK_ENABLE, &aup->enable);
writel(MAC_EN_CLOCK_ENABLE, aup->enable);
au_sync_delay(2);
writel((MAC_EN_RESET0 | MAC_EN_RESET1 | MAC_EN_RESET2
| MAC_EN_CLOCK_ENABLE), &aup->enable);
| MAC_EN_CLOCK_ENABLE), aup->enable);
au_sync_delay(2);

aup->mac_enabled = 1;
Expand Down Expand Up @@ -503,9 +503,9 @@ static void au1000_reset_mac_unlocked(struct net_device *dev)

au1000_hard_stop(dev);

writel(MAC_EN_CLOCK_ENABLE, &aup->enable);
writel(MAC_EN_CLOCK_ENABLE, aup->enable);
au_sync_delay(2);
writel(0, &aup->enable);
writel(0, aup->enable);
au_sync_delay(2);

aup->tx_full = 0;
Expand Down Expand Up @@ -1119,7 +1119,7 @@ static int __devinit au1000_probe(struct platform_device *pdev)
/* set a random MAC now in case platform_data doesn't provide one */
random_ether_addr(dev->dev_addr);

writel(0, &aup->enable);
writel(0, aup->enable);
aup->mac_enabled = 0;

pd = pdev->dev.platform_data;
Expand Down

0 comments on commit 462ca99

Please sign in to comment.