sundance: Wrap up acceess to ASICCtrl high word with a macro
authorDenis Kirjanov <dkirjanov@kernel.org>
Tue, 21 Dec 2010 02:01:36 +0000 (02:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Dec 2010 21:25:08 +0000 (13:25 -0800)
Wrap up acceess to ASICCtrl high word with a macro

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sundance.c

index 3ed2a67bd6d36c5da4608570bc8d494faa614f59..8916f29301d690ad9cbc27a522ba23c9943a2bba 100644 (file)
@@ -294,6 +294,9 @@ enum alta_offsets {
        /* Aliased and bogus values! */
        RxStatus = 0x0c,
 };
+
+#define ASIC_HI_WORD(x)        ((x) + 2)
+
 enum ASICCtrl_HiWord_bit {
        GlobalReset = 0x0001,
        RxReset = 0x0002,
@@ -1772,10 +1775,10 @@ static int netdev_close(struct net_device *dev)
        }
 
        iowrite16(GlobalReset | DMAReset | FIFOReset | NetworkReset,
-                       ioaddr +ASICCtrl + 2);
+                       ioaddr + ASIC_HI_WORD(ASICCtrl));
 
        for (i = 2000; i > 0; i--) {
-               if ((ioread16(ioaddr + ASICCtrl +2) & ResetBusy) == 0)
+               if ((ioread16(ioaddr + ASIC_HI_WORD(ASICCtrl)) & ResetBusy) == 0)
                        break;
                mdelay(1);
        }