return priv->hw->phylink_pcs;
}
+static int socfpga_dwmac_init(struct platform_device *pdev, void *bsp_priv)
+{
+ struct socfpga_dwmac *dwmac = bsp_priv;
+
+ return dwmac->ops->set_phy_mode(dwmac);
+}
+
static int socfpga_dwmac_probe(struct platform_device *pdev)
{
struct plat_stmmacenet_data *plat_dat;
if (ret)
return ret;
- ret = ops->set_phy_mode(dwmac);
+ ret = socfpga_dwmac_init(pdev, dwmac);
if (ret)
goto err_dvr_remove;
#ifdef CONFIG_PM_SLEEP
static int socfpga_dwmac_resume(struct device *dev)
{
- struct net_device *ndev = dev_get_drvdata(dev);
- struct stmmac_priv *priv = netdev_priv(ndev);
struct socfpga_dwmac *dwmac_priv = get_stmmac_bsp_priv(dev);
- dwmac_priv->ops->set_phy_mode(priv->plat->bsp_priv);
+ socfpga_dwmac_init(to_platform_device(dev), dwmac_priv);
return stmmac_resume(dev);
}