net: ravb: Use pm_runtime_resume_and_get()
[ Upstream commit 88b74831faaee455c2af380382d979fc38e79270 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ca9dc0f6cb
commit
bd436c5af5
1 changed files with 4 additions and 1 deletions
|
@ -2074,7 +2074,9 @@ static int ravb_probe(struct platform_device *pdev)
|
||||||
ndev->hw_features = NETIF_F_RXCSUM;
|
ndev->hw_features = NETIF_F_RXCSUM;
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
/* The Ether-specific entries in the device structure. */
|
/* The Ether-specific entries in the device structure. */
|
||||||
ndev->base_addr = res->start;
|
ndev->base_addr = res->start;
|
||||||
|
@ -2249,6 +2251,7 @@ out_release:
|
||||||
free_netdev(ndev);
|
free_netdev(ndev);
|
||||||
|
|
||||||
pm_runtime_put(&pdev->dev);
|
pm_runtime_put(&pdev->dev);
|
||||||
|
out_rpm_disable:
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue