Skip to content

Commit

Permalink
spi: cs42l43: Handle error from devm_pm_runtime_enable
Browse files Browse the repository at this point in the history
[ Upstream commit f9f4b0c ]

As it devm_pm_runtime_enable can fail due to memory allocations, it is
best to handle the error.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20240124174101.2270249-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
charleskeepax authored and gregkh committed Mar 1, 2024
1 parent 6736290 commit ab7318c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/spi/spi-cs42l43.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ static int cs42l43_spi_probe(struct platform_device *pdev)
priv->ctlr->use_gpio_descriptors = true;
priv->ctlr->auto_runtime_pm = true;

devm_pm_runtime_enable(priv->dev);
ret = devm_pm_runtime_enable(priv->dev);
if (ret)
return ret;

pm_runtime_idle(priv->dev);

regmap_write(priv->regmap, CS42L43_TRAN_CONFIG6, CS42L43_FIFO_SIZE - 1);
Expand Down

0 comments on commit ab7318c

Please sign in to comment.