net: convert print_mac to %pM
[deliverable/linux.git] / drivers / net / tc35815.c
index 8487ace9d2e3a8d73a8fedbe32a2447ec9575222..c666448fc7e36f3af41c7e431492e05eea5d7d7a 100644 (file)
@@ -424,7 +424,7 @@ struct tc35815_local {
         */
        spinlock_t lock;
 
-       struct mii_bus mii_bus;
+       struct mii_bus *mii_bus;
        struct phy_device *phy_dev;
        int duplex;
        int speed;
@@ -704,13 +704,13 @@ static int tc_mii_probe(struct net_device *dev)
 
        /* find the first phy */
        for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
-               if (lp->mii_bus.phy_map[phy_addr]) {
+               if (lp->mii_bus->phy_map[phy_addr]) {
                        if (phydev) {
                                printk(KERN_ERR "%s: multiple PHYs found\n",
                                       dev->name);
                                return -EINVAL;
                        }
-                       phydev = lp->mii_bus.phy_map[phy_addr];
+                       phydev = lp->mii_bus->phy_map[phy_addr];
                        break;
                }
        }
@@ -762,23 +762,29 @@ static int tc_mii_init(struct net_device *dev)
        int err;
        int i;
 
-       lp->mii_bus.name = "tc35815_mii_bus";
-       lp->mii_bus.read = tc_mdio_read;
-       lp->mii_bus.write = tc_mdio_write;
-       snprintf(lp->mii_bus.id, MII_BUS_ID_SIZE, "%x",
-                (lp->pci_dev->bus->number << 8) | lp->pci_dev->devfn);
-       lp->mii_bus.priv = dev;
-       lp->mii_bus.dev = &lp->pci_dev->dev;
-       lp->mii_bus.irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
-       if (!lp->mii_bus.irq) {
+       lp->mii_bus = mdiobus_alloc();
+       if (lp->mii_bus == NULL) {
                err = -ENOMEM;
                goto err_out;
        }
 
+       lp->mii_bus->name = "tc35815_mii_bus";
+       lp->mii_bus->read = tc_mdio_read;
+       lp->mii_bus->write = tc_mdio_write;
+       snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%x",
+                (lp->pci_dev->bus->number << 8) | lp->pci_dev->devfn);
+       lp->mii_bus->priv = dev;
+       lp->mii_bus->parent = &lp->pci_dev->dev;
+       lp->mii_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
+       if (!lp->mii_bus->irq) {
+               err = -ENOMEM;
+               goto err_out_free_mii_bus;
+       }
+
        for (i = 0; i < PHY_MAX_ADDR; i++)
-               lp->mii_bus.irq[i] = PHY_POLL;
+               lp->mii_bus->irq[i] = PHY_POLL;
 
-       err = mdiobus_register(&lp->mii_bus);
+       err = mdiobus_register(lp->mii_bus);
        if (err)
                goto err_out_free_mdio_irq;
        err = tc_mii_probe(dev);
@@ -787,9 +793,11 @@ static int tc_mii_init(struct net_device *dev)
        return 0;
 
 err_out_unregister_bus:
-       mdiobus_unregister(&lp->mii_bus);
+       mdiobus_unregister(lp->mii_bus);
 err_out_free_mdio_irq:
-       kfree(lp->mii_bus.irq);
+       kfree(lp->mii_bus->irq);
+err_out_free_mii_bus:
+       mdiobus_free(lp->mii_bus);
 err_out:
        return err;
 }
@@ -857,7 +865,6 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev,
        struct net_device *dev;
        struct tc35815_local *lp;
        int rc;
-       DECLARE_MAC_BUF(mac);
 
        static int printed_version;
        if (!printed_version++) {
@@ -934,11 +941,11 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev,
                goto err_out;
 
        memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
-       printk(KERN_INFO "%s: %s at 0x%lx, %s, IRQ %d\n",
+       printk(KERN_INFO "%s: %s at 0x%lx, %pM, IRQ %d\n",
                dev->name,
                chip_info[ent->driver_data].name,
                dev->base_addr,
-               print_mac(mac, dev->dev_addr),
+               dev->dev_addr,
                dev->irq);
 
        rc = tc_mii_init(dev);
@@ -961,8 +968,9 @@ static void __devexit tc35815_remove_one(struct pci_dev *pdev)
        struct tc35815_local *lp = netdev_priv(dev);
 
        phy_disconnect(lp->phy_dev);
-       mdiobus_unregister(&lp->mii_bus);
-       kfree(lp->mii_bus.irq);
+       mdiobus_unregister(lp->mii_bus);
+       kfree(lp->mii_bus->irq);
+       mdiobus_free(lp->mii_bus);
        unregister_netdev(dev);
        free_netdev(dev);
        pci_set_drvdata(pdev, NULL);
@@ -1279,12 +1287,9 @@ panic_queues(struct net_device *dev)
 
 static void print_eth(const u8 *add)
 {
-       DECLARE_MAC_BUF(mac);
-
        printk(KERN_DEBUG "print_eth(%p)\n", add);
-       printk(KERN_DEBUG " %s =>", print_mac(mac, add + 6));
-       printk(KERN_CONT " %s : %02x%02x\n",
-               print_mac(mac, add), add[12], add[13]);
+       printk(KERN_DEBUG " %pM => %pM : %02x%02x\n",
+               add + 6, add, add[12], add[13]);
 }
 
 static int tc35815_tx_full(struct net_device *dev)
@@ -2144,13 +2149,12 @@ static void tc35815_set_cam_entry(struct net_device *dev, int index, unsigned ch
        int cam_index = index * 6;
        u32 cam_data;
        u32 saved_addr;
-       DECLARE_MAC_BUF(mac);
 
        saved_addr = tc_readl(&tr->CAM_Adr);
 
        if (netif_msg_hw(lp))
-               printk(KERN_DEBUG "%s: CAM %d: %s\n",
-                       dev->name, index, print_mac(mac, addr));
+               printk(KERN_DEBUG "%s: CAM %d: %pM\n",
+                       dev->name, index, addr);
        if (index & 1) {
                /* read modify write */
                tc_writel(cam_index - 2, &tr->CAM_Adr);
This page took 0.028947 seconds and 5 git commands to generate.