struct device_node *node;
int ret;
- node = priv->plat->phy_node;
+ node = priv->plat->phylink_node;
if (node) {
ret = phylink_of_phy_connect(priv->phylink, node, 0);
static int stmmac_phy_setup(struct stmmac_priv *priv)
{
- struct device_node *node = priv->plat->phy_node;
+ struct device_node *node = priv->plat->phylink_node;
int mode = priv->plat->interface;
struct phylink *phylink;
*mac = of_get_mac_address(np);
plat->interface = of_get_phy_mode(np);
- plat->phy_node = np;
+
+ /* Some wrapper drivers still rely on phy_node. Let's save it while
+ * they are not converted to phylink. */
+ plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
+
+ /* PHYLINK automatically parses the phy-handle property */
+ plat->phylink_node = np;
/* Get max speed of operation from device tree */
if (of_property_read_u32(np, "max-speed", &plat->max_speed))
void stmmac_remove_config_dt(struct platform_device *pdev,
struct plat_stmmacenet_data *plat)
{
+ of_node_put(plat->phy_node);
of_node_put(plat->mdio_node);
}
#else
int interface;
struct stmmac_mdio_bus_data *mdio_bus_data;
struct device_node *phy_node;
+ struct device_node *phylink_node;
struct device_node *mdio_node;
struct stmmac_dma_cfg *dma_cfg;
int clk_csr;