spi: meson-spifc: use devm_pm_runtime_set_active_enabled

Use devm_pm_runtime_set_active_enabled to replace
pm_runtime_set_active() + pm_runtime_enable() and drop the out_pm
error label.

Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260722-spifc-v1-1-e4462a4c6a06@gmail.com
Link: https://patch.msgid.link/20260802-spifc-v2-1-46e9d06a3217@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Felix Gu
2026-08-02 01:51:24 +08:00
committed by Mark Brown
parent f092e1c935
commit c10b7f5e0c

View File

@@ -325,26 +325,20 @@ static int meson_spifc_probe(struct platform_device *pdev)
meson_spifc_hw_init(spifc);
pm_runtime_set_active(spifc->dev);
pm_runtime_enable(spifc->dev);
ret = devm_pm_runtime_set_active_enabled(spifc->dev);
if (ret)
return dev_err_probe(spifc->dev, ret, "failed to set runtime PM\n");
ret = devm_spi_register_controller(spifc->dev, host);
if (ret) {
dev_err(spifc->dev, "failed to register spi host\n");
goto out_pm;
}
if (ret)
return dev_err_probe(spifc->dev, ret, "failed to register spi host\n");
return 0;
out_pm:
pm_runtime_disable(spifc->dev);
return ret;
}
static void meson_spifc_remove(struct platform_device *pdev)
{
pm_runtime_get_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
}