Skip to contentSkip to conversation

spi: amlogic-spifc-a1: Handle devm_pm_runtime_enable() errors

PATCH In review Haotian Zhang 2 participants 2 messages Nov 24, 2025 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: amlogic-spifc-a1: Handle devm_pm_runtime_enable() errors

devm_pm_runtime_enable() can fail due to memory allocation. The current code ignores its return value, potentially causing runtime PM operations to fail silently after autosuspend configuration.

Check the return value of devm_pm_runtime_enable() and return on failure.

Fixes 909fac05b926 ("spi: add support for Amlogic A1 SPI Flash Controller")
---
 drivers/spi/spi-amlogic-spifc-a1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/spi/spi-amlogic-spifc-a1.c +3 -1
index 18c9aa2cbc29..eb503790017b 100644
@@ -353,7 +353,9 @@ static int amlogic_spifc_a1_probe(struct platform_device *pdev)
 
 	pm_runtime_set_autosuspend_delay(spifc->dev, 500);
 	pm_runtime_use_autosuspend(spifc->dev);
-	devm_pm_runtime_enable(spifc->dev);
+	ret = devm_pm_runtime_enable(spifc->dev);
+	if (ret)
+		return ret;
 
 	ctrl->num_chipselect = 1;
 	ctrl->dev.of_node = pdev->dev.of_node;
Signature · 1 line
2.50.1.windows.1
maintainer
#1 lore raw
Quoted 8 lines · Haotian Zhang

devm_pm_runtime_enable() can fail due to memory allocation. The current code ignores its return value, potentially causing runtime PM operations to fail silently after autosuspend configuration.

Check the return value of devm_pm_runtime_enable() and return on failure.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: amlogic-spifc-a1: Handle devm_pm_runtime_enable() errors

      commit: a90903c2a3c38bce475f46ea3f93dbf6a9971553

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark