]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: ethernet: ti: am65-cpsw-ethtool: use pm_runtime_resume_and_get
authorMinghao Chi <chi.minghao@zte.com.cn>
Tue, 19 Apr 2022 11:03:52 +0000 (11:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Apr 2022 09:53:17 +0000 (10:53 +0100)
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 <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/am65-cpsw-ethtool.c

index 72acdf8022586fbe0fa73ff789d5ee6ca787474b..abc1e4276cf088f51a46bb725f05956814979a96 100644 (file)
@@ -380,11 +380,9 @@ static int am65_cpsw_ethtool_op_begin(struct net_device *ndev)
        struct am65_cpsw_common *common = am65_ndev_to_common(ndev);
        int ret;
 
-       ret = pm_runtime_get_sync(common->dev);
-       if (ret < 0) {
+       ret = pm_runtime_resume_and_get(common->dev);
+       if (ret < 0)
                dev_err(common->dev, "ethtool begin failed %d\n", ret);
-               pm_runtime_put_noidle(common->dev);
-       }
 
        return ret;
 }