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);
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;
}
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);
}
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);
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;
}
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);
udelay(1);
}
- dev_err(priv->device, "MDIO operation timed out\n");
+ dev_err(priv->dev, "MDIO operation timed out\n");
return -ETIMEDOUT;
}
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;
}
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;
}
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;
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);
}
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);
}
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);
u32 msg_enable;
u32 flags;
- struct device *device;
+ struct device *dev;
unsigned long sysclk;
struct fe_rx_ring rx_ring;
/* 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;
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;
}
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;
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;
}
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;
}