Skip to content

Commit

Permalink
spi: rpc-if: Fix RPM imbalance in probe error path
Browse files Browse the repository at this point in the history
If rpcif_hw_init() fails, Runtime PM is left enabled.

Fixes: b04cc0d ("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>
Link: https://lore.kernel.org/r/1c78a1f447d019bb66b6e7787f520ae78821e2ae.1648562287.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Geert Uytterhoeven authored and Mark Brown committed Apr 4, 2022
1 parent 3123109 commit 2f8cf5f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/spi/spi-rpc-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2f8cf5f

Please sign in to comment.