aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2024-01-25 10:34:26 +0000
committerMark Brown <broonie@kernel.org>2024-01-25 19:44:43 +0000
commita6fc5c5b35f688480167a7a7947ddd91c07e72c8 (patch)
treeafd6da61994538e0051122a64997e1bdcda9851f /drivers/spi
parent4f38ae221e282ece6e2c39b6b85031db5564f594 (diff)
downloadlinux-a6fc5c5b35f688480167a7a7947ddd91c07e72c8.tar.gz
spi: cs42l43: Handle error from devm_pm_runtime_enable()
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> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://msgid.link/r/20240125103426.2622549-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-cs42l43.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/spi/spi-cs42l43.c b/drivers/spi/spi-cs42l43.c
index f13073e1259364..b24190526ce964 100644
--- a/drivers/spi/spi-cs42l43.c
+++ b/drivers/spi/spi-cs42l43.c
@@ -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);