Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7023a293 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Greg Kroah-Hartman
Browse files

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: 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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 05aa8f3e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2039,7 +2039,9 @@ static int ravb_probe(struct platform_device *pdev)
	ndev->hw_features = NETIF_F_RXCSUM;

	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. */
	ndev->base_addr = res->start;
@@ -2210,6 +2212,7 @@ static int ravb_probe(struct platform_device *pdev)
	free_netdev(ndev);

	pm_runtime_put(&pdev->dev);
out_rpm_disable:
	pm_runtime_disable(&pdev->dev);
	return error;
}