diff options
Diffstat (limited to 'drivers/net/dnet.c')
-rw-r--r-- | drivers/net/dnet.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c index 7c075756611a..8318ea06cb6d 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 */ |
30 | u16 dnet_readw_mac(struct dnet *bp, u16 reg) | 30 | static 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 */ |
49 | void dnet_writew_mac(struct dnet *bp, u16 reg, u16 val) | 49 | static 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)); |
@@ -337,8 +337,6 @@ static int dnet_mii_init(struct dnet *bp) | |||
337 | for (i = 0; i < PHY_MAX_ADDR; i++) | 337 | for (i = 0; i < PHY_MAX_ADDR; i++) |
338 | bp->mii_bus->irq[i] = PHY_POLL; | 338 | bp->mii_bus->irq[i] = PHY_POLL; |
339 | 339 | ||
340 | platform_set_drvdata(bp->dev, bp->mii_bus); | ||
341 | |||
342 | if (mdiobus_register(bp->mii_bus)) { | 340 | if (mdiobus_register(bp->mii_bus)) { |
343 | err = -ENXIO; | 341 | err = -ENXIO; |
344 | goto err_out_free_mdio_irq; | 342 | goto err_out_free_mdio_irq; |
@@ -361,7 +359,7 @@ err_out: | |||
361 | } | 359 | } |
362 | 360 | ||
363 | /* For Neptune board: LINK1000 as Link LED and TX as activity LED */ | 361 | /* For Neptune board: LINK1000 as Link LED and TX as activity LED */ |
364 | int dnet_phy_marvell_fixup(struct phy_device *phydev) | 362 | static int dnet_phy_marvell_fixup(struct phy_device *phydev) |
365 | { | 363 | { |
366 | return phy_write(phydev, 0x18, 0x4148); | 364 | return phy_write(phydev, 0x18, 0x4148); |
367 | } | 365 | } |
@@ -863,6 +861,7 @@ static int __devinit dnet_probe(struct platform_device *pdev) | |||
863 | bp = netdev_priv(dev); | 861 | bp = netdev_priv(dev); |
864 | bp->dev = dev; | 862 | bp->dev = dev; |
865 | 863 | ||
864 | platform_set_drvdata(pdev, dev); | ||
866 | SET_NETDEV_DEV(dev, &pdev->dev); | 865 | SET_NETDEV_DEV(dev, &pdev->dev); |
867 | 866 | ||
868 | spin_lock_init(&bp->lock); | 867 | spin_lock_init(&bp->lock); |