tools: fix GNU stat detection to prevent it from picking up other things named "gstat...
[15.05/openwrt.git] / target / linux / lantiq / patches / 800-fix-etop.patch
1 --- a/drivers/net/lantiq_etop.c
2 +++ b/drivers/net/lantiq_etop.c
3 @@ -397,7 +397,10 @@ ltq_etop_get_settings(struct net_device
4  {
5         struct ltq_etop_priv *priv = netdev_priv(dev);
6  
7 -       return phy_ethtool_gset(priv->phydev, cmd);
8 +       if (priv->phydev)
9 +               return phy_ethtool_gset(priv->phydev, cmd);
10 +       else
11 +               return 0;
12  }
13  
14  static int
15 @@ -405,7 +408,10 @@ ltq_etop_set_settings(struct net_device
16  {
17         struct ltq_etop_priv *priv = netdev_priv(dev);
18  
19 -       return phy_ethtool_sset(priv->phydev, cmd);
20 +       if (priv->phydev)
21 +               return phy_ethtool_sset(priv->phydev, cmd);
22 +       else
23 +               return 0;
24  }
25  
26  static int
27 @@ -413,7 +419,10 @@ ltq_etop_nway_reset(struct net_device *d
28  {
29         struct ltq_etop_priv *priv = netdev_priv(dev);
30  
31 -       return phy_start_aneg(priv->phydev);
32 +       if (priv->phydev)
33 +               return phy_start_aneg(priv->phydev);
34 +       else
35 +               return 0;
36  }
37  
38  static const struct ethtool_ops ltq_etop_ethtool_ops = {
39 @@ -615,7 +624,8 @@ ltq_etop_open(struct net_device *dev)
40                 ltq_dma_open(&ch->dma);
41                 napi_enable(&ch->napi);
42         }
43 -       phy_start(priv->phydev);
44 +       if (priv->phydev)
45 +               phy_start(priv->phydev);
46         netif_tx_start_all_queues(dev);
47         return 0;
48  }
49 @@ -627,7 +637,8 @@ ltq_etop_stop(struct net_device *dev)
50         int i;
51  
52         netif_tx_stop_all_queues(dev);
53 -       phy_stop(priv->phydev);
54 +       if (priv->phydev)
55 +               phy_stop(priv->phydev);
56         for (i = 0; i < MAX_DMA_CHAN; i++) {
57                 struct ltq_etop_chan *ch = &priv->ch[i];
58  
59 @@ -775,7 +786,7 @@ ltq_etop_init(struct net_device *dev)
60         ltq_etop_set_multicast_list(dev);
61         err = ltq_etop_mdio_init(dev);
62         if (err)
63 -               goto err_netdev;
64 +               pr_warn("etop: mdio probe failed\n");;
65         return 0;
66  
67  err_netdev: