ethernet: remove redundant memset
[linux-2.6-microblaze.git] / drivers / net / ethernet / freescale / fec_main.c
index a96ad20..e5610a4 100644 (file)
@@ -1655,7 +1655,7 @@ static void fec_get_mac(struct net_device *ndev)
                struct device_node *np = fep->pdev->dev.of_node;
                if (np) {
                        const char *mac = of_get_mac_address(np);
-                       if (mac)
+                       if (!IS_ERR(mac))
                                iap = (unsigned char *) mac;
                }
        }
@@ -1689,10 +1689,10 @@ static void fec_get_mac(struct net_device *ndev)
         */
        if (!is_valid_ether_addr(iap)) {
                /* Report it and use a random ethernet address instead */
-               netdev_err(ndev, "Invalid MAC address: %pM\n", iap);
+               dev_err(&fep->pdev->dev, "Invalid MAC address: %pM\n", iap);
                eth_hw_addr_random(ndev);
-               netdev_info(ndev, "Using random MAC address: %pM\n",
-                           ndev->dev_addr);
+               dev_info(&fep->pdev->dev, "Using random MAC address: %pM\n",
+                        ndev->dev_addr);
                return;
        }
 
@@ -2446,30 +2446,31 @@ static int
 fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)
 {
        struct fec_enet_private *fep = netdev_priv(ndev);
+       struct device *dev = &fep->pdev->dev;
        unsigned int cycle;
 
        if (!(fep->quirks & FEC_QUIRK_HAS_COALESCE))
                return -EOPNOTSUPP;
 
        if (ec->rx_max_coalesced_frames > 255) {
-               pr_err("Rx coalesced frames exceed hardware limitation\n");
+               dev_err(dev, "Rx coalesced frames exceed hardware limitation\n");
                return -EINVAL;
        }
 
        if (ec->tx_max_coalesced_frames > 255) {
-               pr_err("Tx coalesced frame exceed hardware limitation\n");
+               dev_err(dev, "Tx coalesced frame exceed hardware limitation\n");
                return -EINVAL;
        }
 
        cycle = fec_enet_us_to_itr_clock(ndev, fep->rx_time_itr);
        if (cycle > 0xFFFF) {
-               pr_err("Rx coalesced usec exceed hardware limitation\n");
+               dev_err(dev, "Rx coalesced usec exceed hardware limitation\n");
                return -EINVAL;
        }
 
        cycle = fec_enet_us_to_itr_clock(ndev, fep->tx_time_itr);
        if (cycle > 0xFFFF) {
-               pr_err("Rx coalesced usec exceed hardware limitation\n");
+               dev_err(dev, "Rx coalesced usec exceed hardware limitation\n");
                return -EINVAL;
        }
 
@@ -3143,8 +3144,6 @@ static int fec_enet_init(struct net_device *ndev)
                return -ENOMEM;
        }
 
-       memset(cbd_base, 0, bd_size);
-
        /* Get the Ethernet address */
        fec_get_mac(ndev);
        /* make sure MAC we just acquired is programmed into the hw */
@@ -3473,7 +3472,6 @@ fec_probe(struct platform_device *pdev)
                if (ret) {
                        dev_err(&pdev->dev,
                                "Failed to enable phy regulator: %d\n", ret);
-                       clk_disable_unprepare(fep->clk_ipg);
                        goto failed_regulator;
                }
        } else {
@@ -3556,7 +3554,7 @@ failed_init:
        if (fep->reg_phy)
                regulator_disable(fep->reg_phy);
 failed_reset:
-       pm_runtime_put(&pdev->dev);
+       pm_runtime_put_noidle(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 failed_regulator:
        clk_disable_unprepare(fep->clk_ahb);