Skip to content

Commit a90903c

Browse files
ISCAS-Vulabbroonie
authored andcommitted
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: 909fac0 ("spi: add support for Amlogic A1 SPI Flash Controller") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Link: https://patch.msgid.link/20251124015852.937-1-vulab@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 9f0c21b commit a90903c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/spi/spi-amlogic-spifc-a1.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@ static int amlogic_spifc_a1_probe(struct platform_device *pdev)
353353

354354
pm_runtime_set_autosuspend_delay(spifc->dev, 500);
355355
pm_runtime_use_autosuspend(spifc->dev);
356-
devm_pm_runtime_enable(spifc->dev);
356+
ret = devm_pm_runtime_enable(spifc->dev);
357+
if (ret)
358+
return ret;
357359

358360
ctrl->num_chipselect = 1;
359361
ctrl->dev.of_node = pdev->dev.of_node;

0 commit comments

Comments
 (0)