aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>2023-11-28 10:04:35 +0200
committerPaolo Abeni <pabeni@redhat.com>2023-11-30 10:59:07 +0100
commit88b74831faaee455c2af380382d979fc38e79270 (patch)
treecae0023e416370c7979aaf2c9d4307fcb31f123b
parentd8eb6ea4b302e7ff78535c205510e359ac10a0bd (diff)
downloadlinux-88b74831faaee455c2af380382d979fc38e79270.tar.gz
net: ravb: Use pm_runtime_resume_and_get()
pm_runtime_get_sync() may return an error. In case it returns with an error dev->power.usage_count needs to be decremented. pm_runtime_resume_and_get() takes care of this. Thus use it. Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r--drivers/net/ethernet/renesas/ravb_main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 35a6b0a26dcd23..96b38d1e39aebb 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -2659,7 +2659,9 @@ static int ravb_probe(struct platform_device *pdev)
goto out_free_netdev;
pm_runtime_enable(&pdev->dev);
- pm_runtime_get_sync(&pdev->dev);
+ error = pm_runtime_resume_and_get(&pdev->dev);
+ if (error < 0)
+ goto out_rpm_disable;
if (info->multi_irqs) {
if (info->err_mgmt_irqs)
@@ -2885,6 +2887,7 @@ out_disable_refclk:
clk_disable_unprepare(priv->refclk);
out_release:
pm_runtime_put(&pdev->dev);
+out_rpm_disable:
pm_runtime_disable(&pdev->dev);
reset_control_assert(rstc);
out_free_netdev: