aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/dnet.c')
-rw-r--r--drivers/net/dnet.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c
index 7c075756611a..9d8a20b72fa9 100644
--- a/drivers/net/dnet.c
+++ b/drivers/net/dnet.c
@@ -27,7 +27,7 @@
27#undef DEBUG 27#undef DEBUG
28 28
29/* function for reading internal MAC register */ 29/* function for reading internal MAC register */
30u16 dnet_readw_mac(struct dnet *bp, u16 reg) 30static u16 dnet_readw_mac(struct dnet *bp, u16 reg)
31{ 31{
32 u16 data_read; 32 u16 data_read;
33 33
@@ -46,7 +46,7 @@ u16 dnet_readw_mac(struct dnet *bp, u16 reg)
46} 46}
47 47
48/* function for writing internal MAC register */ 48/* function for writing internal MAC register */
49void dnet_writew_mac(struct dnet *bp, u16 reg, u16 val) 49static void dnet_writew_mac(struct dnet *bp, u16 reg, u16 val)
50{ 50{
51 /* load data to write */ 51 /* load data to write */
52 dnet_writel(bp, val, MACREG_DATA); 52 dnet_writel(bp, val, MACREG_DATA);
@@ -63,11 +63,11 @@ static void __dnet_set_hwaddr(struct dnet *bp)
63{ 63{
64 u16 tmp; 64 u16 tmp;
65 65
66 tmp = cpu_to_be16(*((u16 *) bp->dev->dev_addr)); 66 tmp = be16_to_cpup((__be16 *)bp->dev->dev_addr);
67 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG, tmp); 67 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG, tmp);
68 tmp = cpu_to_be16(*((u16 *) (bp->dev->dev_addr + 2))); 68 tmp = be16_to_cpup((__be16 *)(bp->dev->dev_addr + 2));
69 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG, tmp); 69 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG, tmp);
70 tmp = cpu_to_be16(*((u16 *) (bp->dev->dev_addr + 4))); 70 tmp = be16_to_cpup((__be16 *)(bp->dev->dev_addr + 4));
71 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG, tmp); 71 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG, tmp);
72} 72}
73 73
@@ -89,11 +89,11 @@ static void __devinit dnet_get_hwaddr(struct dnet *bp)
89 * Mac_addr[15:0]). 89 * Mac_addr[15:0]).
90 */ 90 */
91 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG); 91 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG);
92 *((u16 *) addr) = be16_to_cpu(tmp); 92 *((__be16 *)addr) = cpu_to_be16(tmp);
93 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG); 93 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG);
94 *((u16 *) (addr + 2)) = be16_to_cpu(tmp); 94 *((__be16 *)(addr + 2)) = cpu_to_be16(tmp);
95 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG); 95 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG);
96 *((u16 *) (addr + 4)) = be16_to_cpu(tmp); 96 *((__be16 *)(addr + 4)) = cpu_to_be16(tmp);
97 97
98 if (is_valid_ether_addr(addr)) 98 if (is_valid_ether_addr(addr))
99 memcpy(bp->dev->dev_addr, addr, sizeof(addr)); 99 memcpy(bp->dev->dev_addr, addr, sizeof(addr));
@@ -361,7 +361,7 @@ err_out:
361} 361}
362 362
363/* For Neptune board: LINK1000 as Link LED and TX as activity LED */ 363/* For Neptune board: LINK1000 as Link LED and TX as activity LED */
364int dnet_phy_marvell_fixup(struct phy_device *phydev) 364static int dnet_phy_marvell_fixup(struct phy_device *phydev)
365{ 365{
366 return phy_write(phydev, 0x18, 0x4148); 366 return phy_write(phydev, 0x18, 0x4148);
367} 367}