aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bfin_mac.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2008-10-13 12:13:56 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-10-13 12:13:56 -0400
commite758936e02700ff88a0b08b722a3847b95283ef2 (patch)
tree50c919bef1b459a778b85159d5929de95b6c4a01 /drivers/net/bfin_mac.c
parent239cfbde1f5843c4a24199f117d5f67f637d72d5 (diff)
parent4480f15b3306f43bbb0310d461142b4e897ca45b (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: include/asm-x86/statfs.h
Diffstat (limited to 'drivers/net/bfin_mac.c')
-rw-r--r--drivers/net/bfin_mac.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 3db7db1828e7..a0d41c5d97d8 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -398,7 +398,7 @@ static int mii_probe(struct net_device *dev)
398 398
399 /* search for connect PHY device */ 399 /* search for connect PHY device */
400 for (i = 0; i < PHY_MAX_ADDR; i++) { 400 for (i = 0; i < PHY_MAX_ADDR; i++) {
401 struct phy_device *const tmp_phydev = lp->mii_bus.phy_map[i]; 401 struct phy_device *const tmp_phydev = lp->mii_bus->phy_map[i];
402 402
403 if (!tmp_phydev) 403 if (!tmp_phydev)
404 continue; /* no PHY here... */ 404 continue; /* no PHY here... */
@@ -811,7 +811,7 @@ static void bfin_mac_enable(void)
811{ 811{
812 u32 opmode; 812 u32 opmode;
813 813
814 pr_debug("%s: %s\n", DRV_NAME, __FUNCTION__); 814 pr_debug("%s: %s\n", DRV_NAME, __func__);
815 815
816 /* Set RX DMA */ 816 /* Set RX DMA */
817 bfin_write_DMA1_NEXT_DESC_PTR(&(rx_list_head->desc_a)); 817 bfin_write_DMA1_NEXT_DESC_PTR(&(rx_list_head->desc_a));
@@ -847,7 +847,7 @@ static void bfin_mac_enable(void)
847/* Our watchdog timed out. Called by the networking layer */ 847/* Our watchdog timed out. Called by the networking layer */
848static void bfin_mac_timeout(struct net_device *dev) 848static void bfin_mac_timeout(struct net_device *dev)
849{ 849{
850 pr_debug("%s: %s\n", dev->name, __FUNCTION__); 850 pr_debug("%s: %s\n", dev->name, __func__);
851 851
852 bfin_mac_disable(); 852 bfin_mac_disable();
853 853
@@ -949,7 +949,7 @@ static int bfin_mac_open(struct net_device *dev)
949{ 949{
950 struct bfin_mac_local *lp = netdev_priv(dev); 950 struct bfin_mac_local *lp = netdev_priv(dev);
951 int retval; 951 int retval;
952 pr_debug("%s: %s\n", dev->name, __FUNCTION__); 952 pr_debug("%s: %s\n", dev->name, __func__);
953 953
954 /* 954 /*
955 * Check that the address is valid. If its not, refuse 955 * Check that the address is valid. If its not, refuse
@@ -989,7 +989,7 @@ static int bfin_mac_open(struct net_device *dev)
989static int bfin_mac_close(struct net_device *dev) 989static int bfin_mac_close(struct net_device *dev)
990{ 990{
991 struct bfin_mac_local *lp = netdev_priv(dev); 991 struct bfin_mac_local *lp = netdev_priv(dev);
992 pr_debug("%s: %s\n", dev->name, __FUNCTION__); 992 pr_debug("%s: %s\n", dev->name, __func__);
993 993
994 netif_stop_queue(dev); 994 netif_stop_queue(dev);
995 netif_carrier_off(dev); 995 netif_carrier_off(dev);
@@ -1058,17 +1058,21 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev)
1058 setup_mac_addr(ndev->dev_addr); 1058 setup_mac_addr(ndev->dev_addr);
1059 1059
1060 /* MDIO bus initial */ 1060 /* MDIO bus initial */
1061 lp->mii_bus.priv = ndev; 1061 lp->mii_bus = mdiobus_alloc();
1062 lp->mii_bus.read = mdiobus_read; 1062 if (lp->mii_bus == NULL)
1063 lp->mii_bus.write = mdiobus_write; 1063 goto out_err_mdiobus_alloc;
1064 lp->mii_bus.reset = mdiobus_reset; 1064
1065 lp->mii_bus.name = "bfin_mac_mdio"; 1065 lp->mii_bus->priv = ndev;
1066 snprintf(lp->mii_bus.id, MII_BUS_ID_SIZE, "0"); 1066 lp->mii_bus->read = mdiobus_read;
1067 lp->mii_bus.irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); 1067 lp->mii_bus->write = mdiobus_write;
1068 lp->mii_bus->reset = mdiobus_reset;
1069 lp->mii_bus->name = "bfin_mac_mdio";
1070 snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "0");
1071 lp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
1068 for (i = 0; i < PHY_MAX_ADDR; ++i) 1072 for (i = 0; i < PHY_MAX_ADDR; ++i)
1069 lp->mii_bus.irq[i] = PHY_POLL; 1073 lp->mii_bus->irq[i] = PHY_POLL;
1070 1074
1071 rc = mdiobus_register(&lp->mii_bus); 1075 rc = mdiobus_register(lp->mii_bus);
1072 if (rc) { 1076 if (rc) {
1073 dev_err(&pdev->dev, "Cannot register MDIO bus!\n"); 1077 dev_err(&pdev->dev, "Cannot register MDIO bus!\n");
1074 goto out_err_mdiobus_register; 1078 goto out_err_mdiobus_register;
@@ -1121,8 +1125,10 @@ out_err_reg_ndev:
1121 free_irq(IRQ_MAC_RX, ndev); 1125 free_irq(IRQ_MAC_RX, ndev);
1122out_err_request_irq: 1126out_err_request_irq:
1123out_err_mii_probe: 1127out_err_mii_probe:
1124 mdiobus_unregister(&lp->mii_bus); 1128 mdiobus_unregister(lp->mii_bus);
1125out_err_mdiobus_register: 1129out_err_mdiobus_register:
1130 mdiobus_free(lp->mii_bus);
1131out_err_mdiobus_alloc:
1126 peripheral_free_list(pin_req); 1132 peripheral_free_list(pin_req);
1127out_err_setup_pin_mux: 1133out_err_setup_pin_mux:
1128out_err_probe_mac: 1134out_err_probe_mac:
@@ -1139,7 +1145,8 @@ static int __devexit bfin_mac_remove(struct platform_device *pdev)
1139 1145
1140 platform_set_drvdata(pdev, NULL); 1146 platform_set_drvdata(pdev, NULL);
1141 1147
1142 mdiobus_unregister(&lp->mii_bus); 1148 mdiobus_unregister(lp->mii_bus);
1149 mdiobus_free(lp->mii_bus);
1143 1150
1144 unregister_netdev(ndev); 1151 unregister_netdev(ndev);
1145 1152