Commit 88b74831 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Paolo Abeni

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: c156633f ("Renesas Ethernet AVB driver proper")
Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent d8eb6ea4
...@@ -2659,7 +2659,9 @@ static int ravb_probe(struct platform_device *pdev) ...@@ -2659,7 +2659,9 @@ static int ravb_probe(struct platform_device *pdev)
goto out_free_netdev; goto out_free_netdev;
pm_runtime_enable(&pdev->dev); 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->multi_irqs) {
if (info->err_mgmt_irqs) if (info->err_mgmt_irqs)
...@@ -2885,6 +2887,7 @@ static int ravb_probe(struct platform_device *pdev) ...@@ -2885,6 +2887,7 @@ static int ravb_probe(struct platform_device *pdev)
clk_disable_unprepare(priv->refclk); clk_disable_unprepare(priv->refclk);
out_release: out_release:
pm_runtime_put(&pdev->dev); pm_runtime_put(&pdev->dev);
out_rpm_disable:
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
reset_control_assert(rstc); reset_control_assert(rstc);
out_free_netdev: out_free_netdev:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment