Message ID | 1c78a1f447d019bb66b6e7787f520ae78821e2ae.1648562287.git.geert+renesas@glider.be (mailing list archive) |
---|---|
State | Accepted |
Commit | 2f8cf5f642e80f8b6b0e660a9c86924a1f41cd80 |
Headers | show |
Series | [1/2] mtd: hyperbus: rpc-if: Fix RPM imbalance in probe error path | expand |
On Tue, Mar 29, 2022 at 04:00:39PM +0200, Geert Uytterhoeven wrote: > If rpcif_hw_init() fails, Runtime PM is left enabled. > > Fixes: b04cc0d912eb80d3 ("memory: renesas-rpc-if: Add support for RZ/G2L") > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
On Tue, Mar 29, 2022 at 8:13 PM Geert Uytterhoeven <geert+renesas@glider.be> wrote: > > If rpcif_hw_init() fails, Runtime PM is left enabled. > > Fixes: b04cc0d912eb80d3 ("memory: renesas-rpc-if: Add support for RZ/G2L") > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > --- > For the spi tree. > > drivers/spi/spi-rpc-if.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Cheers, Prabhakar
diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c index fe82f3575df4f386..24ec1c83f379ceec 100644 --- a/drivers/spi/spi-rpc-if.c +++ b/drivers/spi/spi-rpc-if.c @@ -158,14 +158,18 @@ static int rpcif_spi_probe(struct platform_device *pdev) error = rpcif_hw_init(rpc, false); if (error) - return error; + goto out_disable_rpm; error = spi_register_controller(ctlr); if (error) { dev_err(&pdev->dev, "spi_register_controller failed\n"); - rpcif_disable_rpm(rpc); + goto out_disable_rpm; } + return 0; + +out_disable_rpm: + rpcif_disable_rpm(rpc); return error; }
If rpcif_hw_init() fails, Runtime PM is left enabled. Fixes: b04cc0d912eb80d3 ("memory: renesas-rpc-if: Add support for RZ/G2L") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> --- For the spi tree. drivers/spi/spi-rpc-if.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)