|
@@ -210,56 +210,36 @@ static int stmmac_pltfr_remove(struct platform_device *pdev)
|
|
|
|
|
|
#ifdef CONFIG_PM
|
|
#ifdef CONFIG_PM
|
|
static int stmmac_pltfr_suspend(struct device *dev)
|
|
static int stmmac_pltfr_suspend(struct device *dev)
|
|
-{
|
|
|
|
- struct net_device *ndev = dev_get_drvdata(dev);
|
|
|
|
-
|
|
|
|
- return stmmac_suspend(ndev);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static int stmmac_pltfr_resume(struct device *dev)
|
|
|
|
-{
|
|
|
|
- struct net_device *ndev = dev_get_drvdata(dev);
|
|
|
|
-
|
|
|
|
- return stmmac_resume(ndev);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static int stmmac_pltfr_freeze(struct device *dev)
|
|
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
- struct plat_stmmacenet_data *plat_dat = dev_get_platdata(dev);
|
|
|
|
struct net_device *ndev = dev_get_drvdata(dev);
|
|
struct net_device *ndev = dev_get_drvdata(dev);
|
|
|
|
+ struct stmmac_priv *priv = netdev_priv(ndev);
|
|
struct platform_device *pdev = to_platform_device(dev);
|
|
struct platform_device *pdev = to_platform_device(dev);
|
|
|
|
|
|
- ret = stmmac_freeze(ndev);
|
|
|
|
- if (plat_dat->exit)
|
|
|
|
- plat_dat->exit(pdev);
|
|
|
|
|
|
+ ret = stmmac_suspend(ndev);
|
|
|
|
+ if (priv->plat->exit)
|
|
|
|
+ priv->plat->exit(pdev);
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-static int stmmac_pltfr_restore(struct device *dev)
|
|
|
|
|
|
+static int stmmac_pltfr_resume(struct device *dev)
|
|
{
|
|
{
|
|
- struct plat_stmmacenet_data *plat_dat = dev_get_platdata(dev);
|
|
|
|
struct net_device *ndev = dev_get_drvdata(dev);
|
|
struct net_device *ndev = dev_get_drvdata(dev);
|
|
|
|
+ struct stmmac_priv *priv = netdev_priv(ndev);
|
|
struct platform_device *pdev = to_platform_device(dev);
|
|
struct platform_device *pdev = to_platform_device(dev);
|
|
|
|
|
|
- if (plat_dat->init)
|
|
|
|
- plat_dat->init(pdev);
|
|
|
|
|
|
+ if (priv->plat->init)
|
|
|
|
+ priv->plat->init(pdev);
|
|
|
|
|
|
- return stmmac_restore(ndev);
|
|
|
|
|
|
+ return stmmac_resume(ndev);
|
|
}
|
|
}
|
|
|
|
|
|
-static const struct dev_pm_ops stmmac_pltfr_pm_ops = {
|
|
|
|
- .suspend = stmmac_pltfr_suspend,
|
|
|
|
- .resume = stmmac_pltfr_resume,
|
|
|
|
- .freeze = stmmac_pltfr_freeze,
|
|
|
|
- .thaw = stmmac_pltfr_restore,
|
|
|
|
- .restore = stmmac_pltfr_restore,
|
|
|
|
-};
|
|
|
|
-#else
|
|
|
|
-static const struct dev_pm_ops stmmac_pltfr_pm_ops;
|
|
|
|
#endif /* CONFIG_PM */
|
|
#endif /* CONFIG_PM */
|
|
|
|
|
|
|
|
+static SIMPLE_DEV_PM_OPS(stmmac_pltfr_pm_ops,
|
|
|
|
+ stmmac_pltfr_suspend, stmmac_pltfr_resume);
|
|
|
|
+
|
|
static const struct of_device_id stmmac_dt_ids[] = {
|
|
static const struct of_device_id stmmac_dt_ids[] = {
|
|
{ .compatible = "st,spear600-gmac"},
|
|
{ .compatible = "st,spear600-gmac"},
|
|
{ .compatible = "snps,dwmac-3.610"},
|
|
{ .compatible = "snps,dwmac-3.610"},
|