mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 14:33:24 -04:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user