]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/davinci_emac.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
[karo-tx-linux.git] / drivers / net / davinci_emac.c
index 34e03104c3c16de1d7f9ebcd709caf110eff3112..3f5db83c7cbb29d6d1d313f961839ecdf7cd0873 100644 (file)
@@ -956,19 +956,18 @@ static void emac_dev_mcast_set(struct net_device *ndev)
        } else {
                mbp_enable = (mbp_enable & ~EMAC_MBP_RXPROMISC);
                if ((ndev->flags & IFF_ALLMULTI) ||
-                   (ndev->mc_count > EMAC_DEF_MAX_MULTICAST_ADDRESSES)) {
+                   netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) {
                        mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
                        emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL);
                }
-               if (ndev->mc_count > 0) {
+               if (!netdev_mc_empty(ndev)) {
                        struct dev_mc_list *mc_ptr;
                        mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
                        emac_add_mcast(priv, EMAC_ALL_MULTI_CLR, NULL);
                        /* program multicast address list into EMAC hardware */
-                       for (mc_ptr = ndev->mc_list; mc_ptr;
-                            mc_ptr = mc_ptr->next) {
+                       netdev_for_each_mc_addr(mc_ptr, ndev) {
                                emac_add_mcast(priv, EMAC_MULTICAST_ADD,
-                                              (u8 *)mc_ptr->dmi_addr);
+                                              (u8 *) mc_ptr->dmi_addr);
                        }
                } else {
                        mbp_enable = (mbp_enable & ~EMAC_MBP_RXMCAST);
@@ -2672,8 +2671,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
        priv->emac_base_phys = res->start + pdata->ctrl_reg_offset;
        size = res->end - res->start + 1;
        if (!request_mem_region(res->start, size, ndev->name)) {
-               dev_err(emac_dev, "DaVinci EMAC: failed request_mem_region() \
-                                        for regs\n");
+               dev_err(emac_dev, "DaVinci EMAC: failed request_mem_region() for regs\n");
                rc = -ENXIO;
                goto probe_quit;
        }
@@ -2711,6 +2709,8 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
        SET_ETHTOOL_OPS(ndev, &ethtool_ops);
        netif_napi_add(ndev, &priv->napi, emac_poll, EMAC_POLL_WEIGHT);
 
+       clk_enable(emac_clk);
+
        /* register the network device */
        SET_NETDEV_DEV(ndev, &pdev->dev);
        rc = register_netdev(ndev);
@@ -2720,7 +2720,6 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
                goto netdev_reg_err;
        }
 
-       clk_enable(emac_clk);
 
        /* MII/Phy intialisation, mdio bus registration */
        emac_mii = mdiobus_alloc();
@@ -2760,6 +2759,7 @@ mdiobus_quit:
 
 netdev_reg_err:
 mdio_alloc_err:
+       clk_disable(emac_clk);
 no_irq_res:
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        release_mem_region(res->start, res->end - res->start + 1);