ramips: fix the number of uarts for MT7688
[openwrt/staging/florian.git] / target / linux / mediatek / patches-4.4 / 0102-net-mediatek-v4.4-backports.patch
1 From c1ff5519a7fd849da5d169036d8175383f807962 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Mon, 11 Apr 2016 06:00:23 +0200
4 Subject: [PATCH 102/102] net: mediatek: v4.4 backports
5
6 ---
7 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 13 ++++++++-----
8 1 file changed, 8 insertions(+), 5 deletions(-)
9
10 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
11 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
12 @@ -217,7 +217,7 @@ static int mtk_phy_connect_node(struct m
13
14 dev_info(eth->dev,
15 "connected mac %d to PHY at %s [uid=%08x, driver=%s]\n",
16 - mac->id, phydev_name(phydev), phydev->phy_id,
17 + mac->id, dev_name(&phydev->dev), phydev->phy_id,
18 phydev->drv->name);
19
20 mac->phy_dev = phydev;
21 @@ -1396,6 +1396,7 @@ static int mtk_stop(struct net_device *d
22 struct mtk_mac *mac = netdev_priv(dev);
23 struct mtk_eth *eth = mac->hw;
24
25 + netif_carrier_off(dev);
26 netif_tx_disable(dev);
27 phy_stop(mac->phy_dev);
28
29 @@ -1595,11 +1596,13 @@ static int mtk_set_settings(struct net_d
30 {
31 struct mtk_mac *mac = netdev_priv(dev);
32
33 - if (cmd->phy_address != mac->phy_dev->mdio.addr) {
34 - mac->phy_dev = mdiobus_get_phy(mac->hw->mii_bus,
35 - cmd->phy_address);
36 - if (!mac->phy_dev)
37 + if (cmd->phy_address != mac->phy_dev->addr) {
38 + if (mac->hw->mii_bus->phy_map[cmd->phy_address]) {
39 + mac->phy_dev =
40 + mac->hw->mii_bus->phy_map[cmd->phy_address];
41 + } else {
42 return -ENODEV;
43 + }
44 }
45
46 return phy_ethtool_sset(mac->phy_dev, cmd);