]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
spi: cs42l43: Handle error from devm_pm_runtime_enable
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Wed, 24 Jan 2024 17:41:01 +0000 (17:41 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:34:49 +0000 (13:34 +0100)
[ Upstream commit f9f4b0c6425eb9ffd9bf62b8b8143e786b6ba695 ]

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>
drivers/spi/spi-cs42l43.c

index d239fc5a49ccca737f81f8756c3e826f7e04dc81..c1556b652909226b9e1a7ce0eeacf3ed80595809 100644 (file)
@@ -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);