[lantiq] adds a fix for ar8216 mii detection on etop driver
[openwrt.git] / target / linux / lantiq / patches-3.7 / 0304-etop.patch
1 Index: linux-3.7.1/drivers/net/ethernet/lantiq_etop.c
2 ===================================================================
3 --- linux-3.7.1.orig/drivers/net/ethernet/lantiq_etop.c 2012-12-19 17:06:46.282857707 +0100
4 +++ linux-3.7.1/drivers/net/ethernet/lantiq_etop.c      2012-12-19 17:09:26.710861534 +0100
5 @@ -335,16 +335,17 @@
6  ltq_etop_hw_init(struct net_device *dev)
7  {
8         struct ltq_etop_priv *priv = netdev_priv(dev);
9 +       int mii_mode = priv->mii_mode;
10  
11         clk_enable(priv->clk_ppe);
12  
13         if (of_machine_is_compatible("lantiq,ar9")) {
14                 ltq_etop_gbit_init(dev);
15                 /* force the etops link to the gbit to MII */
16 -               priv->mii_mode = PHY_INTERFACE_MODE_MII;
17 +               mii_mode = PHY_INTERFACE_MODE_MII;
18         }
19  
20 -       switch (priv->mii_mode) {
21 +       switch (mii_mode) {
22         case PHY_INTERFACE_MODE_RMII:
23                 ltq_etop_w32_mask(ETOP_MII_MASK,
24                         ETOP_MII_REVERSE, LTQ_ETOP_CFG);
25 @@ -369,7 +370,7 @@
26                         break;
27                 }
28                 netdev_err(dev, "unknown mii mode %d\n",
29 -                       priv->mii_mode);
30 +                       mii_mode);
31                 return -ENOTSUPP;
32         }
33