Skip to content

Commit 88b7483

Browse files
claudiubezneaPaolo Abeni
authored andcommitted
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: c156633 ("Renesas Ethernet AVB driver proper") Reviewed-by: Sergey Shtylyov <[email protected]> Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent d8eb6ea commit 88b7483

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2659,7 +2659,9 @@ static int ravb_probe(struct platform_device *pdev)
26592659
goto out_free_netdev;
26602660

26612661
pm_runtime_enable(&pdev->dev);
2662-
pm_runtime_get_sync(&pdev->dev);
2662+
error = pm_runtime_resume_and_get(&pdev->dev);
2663+
if (error < 0)
2664+
goto out_rpm_disable;
26632665

26642666
if (info->multi_irqs) {
26652667
if (info->err_mgmt_irqs)
@@ -2885,6 +2887,7 @@ static int ravb_probe(struct platform_device *pdev)
28852887
clk_disable_unprepare(priv->refclk);
28862888
out_release:
28872889
pm_runtime_put(&pdev->dev);
2890+
out_rpm_disable:
28882891
pm_runtime_disable(&pdev->dev);
28892892
reset_control_assert(rstc);
28902893
out_free_netdev:

0 commit comments

Comments
 (0)