diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 782f903d318f..0f2170af9b10 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -1671,7 +1672,7 @@ static int axienet_open(struct net_device *ndev) ret = axienet_device_reset(ndev); axienet_unlock_mii(lp); - ret = phylink_of_phy_connect(lp->phylink, lp->dev->of_node, 0); + ret = phylink_fwnode_phy_connect(lp->phylink, dev_fwnode(lp->dev), 0); if (ret) { dev_err(lp->dev, "phylink_of_phy_connect() failed: %d\n", ret); return ret; @@ -2898,7 +2899,7 @@ static int axienet_probe(struct platform_device *pdev) * Here we check for memory allocated for Rx/Tx in the hardware from * the device-tree and accordingly set flags. */ - ret = of_property_read_u32(pdev->dev.of_node, "xlnx,rxmem", &lp->rxmem); + ret = device_property_read_u32(&pdev->dev, "xlnx,rxmem", &lp->rxmem); if (ret) return dev_err_probe(&pdev->dev, ret, "failed to read xlnx,rxmem property\n"); @@ -2930,9 +2931,10 @@ static int axienet_probe(struct platform_device *pdev) return -EINVAL; } } else { - ret = of_get_phy_mode(pdev->dev.of_node, &lp->phy_mode); - if (ret) + ret = device_get_phy_mode(&pdev->dev); + if (ret < 0) return ret; + lp->phy_mode = ret; } if (lp->switch_x_sgmii && lp->phy_mode != PHY_INTERFACE_MODE_SGMII && lp->phy_mode != PHY_INTERFACE_MODE_1000BASEX) { @@ -3060,7 +3062,7 @@ static int axienet_probe(struct platform_device *pdev) dev_info(&pdev->dev, "Ethernet core IRQ not defined\n"); /* Retrieve the MAC address */ - ret = of_get_mac_address(pdev->dev.of_node, mac_addr); + ret = device_get_mac_address(&pdev->dev, mac_addr); if (!ret) { axienet_set_mac_address(ndev, mac_addr); } else {