Skip to content

Commit 81669e7

Browse files
Minghao Chidavem330
authored andcommitted
net: ethernet: ti: davinci_emac: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot <[email protected]> Signed-off-by: Minghao Chi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bb57843 commit 81669e7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/net/ethernet/ti/davinci_emac.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,9 +1422,8 @@ static int emac_dev_open(struct net_device *ndev)
14221422
struct phy_device *phydev = NULL;
14231423
struct device *phy = NULL;
14241424

1425-
ret = pm_runtime_get_sync(&priv->pdev->dev);
1425+
ret = pm_runtime_resume_and_get(&priv->pdev->dev);
14261426
if (ret < 0) {
1427-
pm_runtime_put_noidle(&priv->pdev->dev);
14281427
dev_err(&priv->pdev->dev, "%s: failed to get_sync(%d)\n",
14291428
__func__, ret);
14301429
return ret;
@@ -1661,9 +1660,8 @@ static struct net_device_stats *emac_dev_getnetstats(struct net_device *ndev)
16611660
u32 stats_clear_mask;
16621661
int err;
16631662

1664-
err = pm_runtime_get_sync(&priv->pdev->dev);
1663+
err = pm_runtime_resume_and_get(&priv->pdev->dev);
16651664
if (err < 0) {
1666-
pm_runtime_put_noidle(&priv->pdev->dev);
16671665
dev_err(&priv->pdev->dev, "%s: failed to get_sync(%d)\n",
16681666
__func__, err);
16691667
return &ndev->stats;
@@ -1954,9 +1952,8 @@ static int davinci_emac_probe(struct platform_device *pdev)
19541952
netif_napi_add(ndev, &priv->napi, emac_poll, EMAC_POLL_WEIGHT);
19551953

19561954
pm_runtime_enable(&pdev->dev);
1957-
rc = pm_runtime_get_sync(&pdev->dev);
1955+
rc = pm_runtime_resume_and_get(&pdev->dev);
19581956
if (rc < 0) {
1959-
pm_runtime_put_noidle(&pdev->dev);
19601957
dev_err(&pdev->dev, "%s: failed to get_sync(%d)\n",
19611958
__func__, rc);
19621959
goto err_napi_del;

0 commit comments

Comments
 (0)