Message ID | 20231127090426.3761729-3-claudiu.beznea.uj@bp.renesas.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | net: ravb: Fixes for the ravb driver | expand |
On 11/27/23 12:04 PM, Claudiu wrote: > From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> > > 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") > Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> [...] > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c > index 50c4c79be035..cd3474168452 100644 > --- a/drivers/net/ethernet/renesas/ravb_main.c > +++ b/drivers/net/ethernet/renesas/ravb_main.c [...] > @@ -2876,6 +2878,7 @@ static int ravb_probe(struct platform_device *pdev) > clk_disable_unprepare(priv->refclk); > out_release: > pm_runtime_put(&pdev->dev); > +out_runtime_disable: I'd suggest a shorter name, like out_rpm_disable... > pm_runtime_disable(&pdev->dev); > reset_control_assert(rstc); > out_free_netdev: > [...] MBR, Sergey
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 50c4c79be035..cd3474168452 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2650,7 +2650,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_runtime_disable; if (info->multi_irqs) { if (info->err_mgmt_irqs) @@ -2876,6 +2878,7 @@ static int ravb_probe(struct platform_device *pdev) clk_disable_unprepare(priv->refclk); out_release: pm_runtime_put(&pdev->dev); +out_runtime_disable: pm_runtime_disable(&pdev->dev); reset_control_assert(rstc); out_free_netdev: