ramips: rename ethernet priv->device field to dev to match upstream
authorFelix Fietkau <nbd@nbd.name>
Fri, 23 Mar 2018 12:37:00 +0000 (13:37 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 23 Mar 2018 19:56:34 +0000 (20:56 +0100)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/ethtool.c
target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mdio.c
target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mdio_rt2880.c
target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c
target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.h
target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/soc_mt7620.c
target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/soc_mt7621.c

index 803346a..5732c28 100644 (file)
@@ -70,9 +70,9 @@ static void fe_get_drvinfo(struct net_device *dev,
        struct fe_priv *priv = netdev_priv(dev);
        struct fe_soc_data *soc = priv->soc;
 
-       strlcpy(info->driver, priv->device->driver->name, sizeof(info->driver));
+       strlcpy(info->driver, priv->dev->driver->name, sizeof(info->driver));
        strlcpy(info->version, MTK_FE_DRV_VERSION, sizeof(info->version));
-       strlcpy(info->bus_info, dev_name(priv->device), sizeof(info->bus_info));
+       strlcpy(info->bus_info, dev_name(priv->dev), sizeof(info->bus_info));
 
        if (soc->reg_table[FE_REG_FE_COUNTER_BASE])
                info->n_stats = ARRAY_SIZE(fe_gdma_str);
index d3798bb..c010552 100644 (file)
@@ -74,7 +74,7 @@ int fe_connect_phy_node(struct fe_priv *priv, struct device_node *phy_node)
        port = be32_to_cpu(*_port);
        phy_mode = of_get_phy_mode(phy_node);
        if (phy_mode < 0) {
-               dev_err(priv->device, "incorrect phy-mode %d\n", phy_mode);
+               dev_err(priv->dev, "incorrect phy-mode %d\n", phy_mode);
                priv->phy->phy_node[port] = NULL;
                return -EINVAL;
        }
@@ -82,7 +82,7 @@ int fe_connect_phy_node(struct fe_priv *priv, struct device_node *phy_node)
        phydev = of_phy_connect(priv->netdev, phy_node, fe_phy_link_adjust,
                                0, phy_mode);
        if (IS_ERR(phydev)) {
-               dev_err(priv->device, "could not connect to PHY\n");
+               dev_err(priv->dev, "could not connect to PHY\n");
                priv->phy->phy_node[port] = NULL;
                return PTR_ERR(phydev);
        }
@@ -91,7 +91,7 @@ int fe_connect_phy_node(struct fe_priv *priv, struct device_node *phy_node)
        phydev->advertising = phydev->supported;
        phydev->no_auto_carrier_off = 1;
 
-       dev_info(priv->device,
+       dev_info(priv->dev,
                 "connected port %d to PHY at %s [uid=%08x, driver=%s]\n",
                 port, dev_name(&phydev->mdio.dev), phydev->phy_id,
                 phydev->drv->name);
@@ -209,9 +209,9 @@ int fe_mdio_init(struct fe_priv *priv)
        spin_lock_init(&phy_ralink.lock);
        priv->phy = &phy_ralink;
 
-       mii_np = of_get_child_by_name(priv->device->of_node, "mdio-bus");
+       mii_np = of_get_child_by_name(priv->dev->of_node, "mdio-bus");
        if (!mii_np) {
-               dev_err(priv->device, "no %s child node found", "mdio-bus");
+               dev_err(priv->dev, "no %s child node found", "mdio-bus");
                return -ENODEV;
        }
 
@@ -231,7 +231,7 @@ int fe_mdio_init(struct fe_priv *priv)
        priv->mii_bus->write = priv->soc->mdio_write;
        priv->mii_bus->reset = fe_mdio_reset;
        priv->mii_bus->priv = priv;
-       priv->mii_bus->parent = priv->device;
+       priv->mii_bus->parent = priv->dev;
 
        snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s", mii_np->name);
        err = of_mdiobus_register(priv->mii_bus, mii_np);
index e72f8c7..e53fd7f 100644 (file)
@@ -101,7 +101,7 @@ static int rt2880_mdio_wait_ready(struct fe_priv *priv)
                udelay(1);
        }
 
-       dev_err(priv->device, "MDIO operation timed out\n");
+       dev_err(priv->dev, "MDIO operation timed out\n");
        return -ETIMEDOUT;
 }
 
@@ -182,7 +182,7 @@ void rt2880_port_init(struct fe_priv *priv, struct device_node *np)
                break;
        default:
                if (!priv->phy->phy_fixed[0])
-                       dev_err(priv->device, "port %d - invalid phy mode\n",
+                       dev_err(priv->dev, "port %d - invalid phy mode\n",
                                priv->phy->speed[0]);
                break;
        }
@@ -207,12 +207,12 @@ void rt2880_port_init(struct fe_priv *priv, struct device_node *np)
                case SPEED_1000:
                        break;
                default:
-                       dev_err(priv->device, "invalid link speed: %d\n",
+                       dev_err(priv->dev, "invalid link speed: %d\n",
                                priv->phy->speed[0]);
                        priv->phy->phy_fixed[0] = 0;
                        return;
                }
-               dev_info(priv->device, "using fixed link parameters\n");
+               dev_info(priv->dev, "using fixed link parameters\n");
                rt2880_mdio_link_adjust(priv, 0);
                return;
        }
index db7b5b2..03da3bb 100644 (file)
@@ -1142,8 +1142,8 @@ static int fe_hw_init(struct net_device *dev)
        struct fe_priv *priv = netdev_priv(dev);
        int i, err;
 
-       err = devm_request_irq(priv->device, dev->irq, fe_handle_irq, 0,
-                              dev_name(priv->device), dev);
+       err = devm_request_irq(priv->dev, dev->irq, fe_handle_irq, 0,
+                              dev_name(priv->dev), dev);
        if (err)
                return err;
 
@@ -1261,14 +1261,14 @@ static int __init fe_init(struct net_device *dev)
                        return -ENODEV;
                }
 
-       mac_addr = of_get_mac_address(priv->device->of_node);
+       mac_addr = of_get_mac_address(priv->dev->of_node);
        if (mac_addr)
                ether_addr_copy(dev->dev_addr, mac_addr);
 
        /* If the mac address is invalid, use random mac address  */
        if (!is_valid_ether_addr(dev->dev_addr)) {
                random_ether_addr(dev->dev_addr);
-               dev_err(priv->device, "generated random MAC address %pM\n",
+               dev_err(priv->dev, "generated random MAC address %pM\n",
                        dev->dev_addr);
        }
 
@@ -1277,7 +1277,7 @@ static int __init fe_init(struct net_device *dev)
                return err;
 
        if (priv->soc->port_init)
-               for_each_child_of_node(priv->device->of_node, port)
+               for_each_child_of_node(priv->dev->of_node, port)
                        if (of_device_is_compatible(port, "mediatek,eth-port") &&
                            of_device_is_available(port))
                                priv->soc->port_init(priv, port);
@@ -1525,7 +1525,7 @@ static int fe_probe(struct platform_device *pdev)
        }
 
        priv->netdev = netdev;
-       priv->device = &pdev->dev;
+       priv->dev = &pdev->dev;
        priv->soc = soc;
        priv->msg_enable = netif_msg_init(fe_msg_level, FE_DEFAULT_MSG_ENABLE);
        priv->rx_ring.frag_size = fe_max_frag_size(ETH_DATA_LEN);
index 6a946c7..0601127 100644 (file)
@@ -480,7 +480,7 @@ struct fe_priv {
        u32                             msg_enable;
        u32                             flags;
 
-       struct device                   *device;
+       struct device                   *dev;
        unsigned long                   sysclk;
 
        struct fe_rx_ring               rx_ring;
index 40bbec4..7f728d1 100644 (file)
@@ -97,10 +97,10 @@ static int mt7620_gsw_config(struct fe_priv *priv)
 
        /* is the mt7530 internal or external */
        if (priv->mii_bus && mdiobus_get_phy(priv->mii_bus, 0x1f)) {
-               mt7530_probe(priv->device, gsw->base, NULL, 0);
-               mt7530_probe(priv->device, NULL, priv->mii_bus, 1);
+               mt7530_probe(priv->dev, gsw->base, NULL, 0);
+               mt7530_probe(priv->dev, NULL, priv->mii_bus, 1);
        } else {
-               mt7530_probe(priv->device, gsw->base, NULL, 1);
+               mt7530_probe(priv->dev, gsw->base, NULL, 1);
        }
 
        return 0;
@@ -180,7 +180,7 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
                mask = 2;
                break;
        default:
-               dev_err(priv->device, "port %d - invalid phy mode\n", id);
+               dev_err(priv->dev, "port %d - invalid phy mode\n", id);
                return;
        }
 
@@ -215,7 +215,7 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
                        val = 2;
                        break;
                default:
-                       dev_err(priv->device, "invalid link speed: %d\n",
+                       dev_err(priv->dev, "invalid link speed: %d\n",
                                priv->phy->speed[id]);
                        priv->phy->phy_fixed[id] = 0;
                        return;
@@ -230,7 +230,7 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
                if (priv->phy->duplex[id])
                        val |= PMCR_DUPLEX;
                mtk_switch_w32(gsw, val, GSW_REG_PORT_PMCR(id));
-               dev_info(priv->device, "using fixed link parameters\n");
+               dev_info(priv->dev, "using fixed link parameters\n");
                return;
        }
 
index ce41b34..00dd45e 100644 (file)
@@ -83,7 +83,7 @@ static const u16 mt7621_reg_table[FE_REG_COUNT] = {
 static int mt7621_gsw_config(struct fe_priv *priv)
 {
        if (priv->mii_bus &&  mdiobus_get_phy(priv->mii_bus, 0x1f))
-               mt7530_probe(priv->device, NULL, priv->mii_bus, 1);
+               mt7530_probe(priv->dev, NULL, priv->mii_bus, 1);
 
        return 0;
 }