Skip to content

Commit

Permalink
net: ravb: Use pm_runtime_resume_and_get()
Browse files Browse the repository at this point in the history
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: c156633 ("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>
  • Loading branch information
Claudiu Beznea authored and Paolo Abeni committed Nov 30, 2023
1 parent d8eb6ea commit 88b7483
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/ethernet/renesas/ravb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -2885,6 +2887,7 @@ static int ravb_probe(struct platform_device *pdev)
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:
Expand Down

0 comments on commit 88b7483

Please sign in to comment.