]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
xilinx_emacps: Fixes a potential bug for PEEP
authorAnirudha Sarangi <anirudh@xilinx.com>
Wed, 3 Apr 2013 17:36:58 +0000 (23:06 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 4 Apr 2013 05:46:13 +0000 (07:46 +0200)
This patch fixes a very minor bug that can show up when someone
tests the Ethernet interface on PEEP. The bug is related to PHY
handling. This patch fixes it.

Signed-off-by: Anirudha Sarangi <anirudh@xilinx.com>
drivers/net/ethernet/xilinx/xilinx_emacps.c

index bca744d24a036adb2f1724abb97c95501247834b..8a7c19e8a6413b060694ef98cb7477eb3b2bb95a 100644 (file)
@@ -1868,8 +1868,10 @@ static int xemacps_close(struct net_device *ndev)
        netif_carrier_off(ndev);
        spin_unlock(&lp->rx_lock);
        spin_unlock_bh(&lp->tx_lock);
-       if (lp->phy_dev)
-               phy_disconnect(lp->phy_dev);
+       if (lp->phy_dev) {
+               if (lp->board_type == BOARD_TYPE_ZYNQ)
+                       phy_disconnect(lp->phy_dev);
+               }
        xemacps_descriptor_free(lp);
 
        pm_runtime_put(&lp->pdev->dev);
@@ -1913,8 +1915,10 @@ static void xemacps_reinit_for_txtimeout(struct work_struct *data)
        lp->link    = 0;
        lp->speed   = 0;
        lp->duplex  = -1;
-       if (lp->phy_dev)
+       if (lp->phy_dev) {
+               if (lp->board_type == BOARD_TYPE_ZYNQ)
                        phy_start(lp->phy_dev);
+       }
        napi_enable(&lp->napi);
        tasklet_enable(&lp->tx_bdreclaim_tasklet);
        netif_start_queue(lp->ndev);