aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index e4bff181c910..6a9509ccd33b 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2772,6 +2772,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
2772 if (!ndev) 2772 if (!ndev)
2773 return -ENOMEM; 2773 return -ENOMEM;
2774 2774
2775 pm_runtime_enable(&pdev->dev);
2776 pm_runtime_get_sync(&pdev->dev);
2777
2775 /* The sh Ether-specific entries in the device structure. */ 2778 /* The sh Ether-specific entries in the device structure. */
2776 ndev->base_addr = res->start; 2779 ndev->base_addr = res->start;
2777 devno = pdev->id; 2780 devno = pdev->id;
@@ -2799,8 +2802,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
2799 2802
2800 spin_lock_init(&mdp->lock); 2803 spin_lock_init(&mdp->lock);
2801 mdp->pdev = pdev; 2804 mdp->pdev = pdev;
2802 pm_runtime_enable(&pdev->dev);
2803 pm_runtime_resume(&pdev->dev);
2804 2805
2805 if (pdev->dev.of_node) 2806 if (pdev->dev.of_node)
2806 pd = sh_eth_parse_dt(&pdev->dev); 2807 pd = sh_eth_parse_dt(&pdev->dev);
@@ -2898,6 +2899,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
2898 netdev_info(ndev, "Base address at 0x%x, %pM, IRQ %d.\n", 2899 netdev_info(ndev, "Base address at 0x%x, %pM, IRQ %d.\n",
2899 (u32)ndev->base_addr, ndev->dev_addr, ndev->irq); 2900 (u32)ndev->base_addr, ndev->dev_addr, ndev->irq);
2900 2901
2902 pm_runtime_put(&pdev->dev);
2901 platform_set_drvdata(pdev, ndev); 2903 platform_set_drvdata(pdev, ndev);
2902 2904
2903 return ret; 2905 return ret;
@@ -2911,6 +2913,8 @@ out_release:
2911 if (ndev) 2913 if (ndev)
2912 free_netdev(ndev); 2914 free_netdev(ndev);
2913 2915
2916 pm_runtime_put(&pdev->dev);
2917 pm_runtime_disable(&pdev->dev);
2914 return ret; 2918 return ret;
2915} 2919}
2916 2920