diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c index aec724e3f824..19c8250ddb64 100644 --- a/drivers/spi/spi-img-spfi.c +++ b/drivers/spi/spi-img-spfi.c @@ -677,7 +677,6 @@ static void img_spfi_remove(struct platform_device *pdev) } } -#ifdef CONFIG_PM static int img_spfi_runtime_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -706,9 +705,7 @@ static int img_spfi_runtime_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM */ -#ifdef CONFIG_PM_SLEEP static int img_spfi_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -730,12 +727,10 @@ static int img_spfi_resume(struct device *dev) return spi_controller_resume(host); } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops img_spfi_pm_ops = { - SET_RUNTIME_PM_OPS(img_spfi_runtime_suspend, img_spfi_runtime_resume, - NULL) - SET_SYSTEM_SLEEP_PM_OPS(img_spfi_suspend, img_spfi_resume) + RUNTIME_PM_OPS(img_spfi_runtime_suspend, img_spfi_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(img_spfi_suspend, img_spfi_resume) }; static const struct of_device_id img_spfi_of_match[] = { @@ -747,7 +742,7 @@ MODULE_DEVICE_TABLE(of, img_spfi_of_match); static struct platform_driver img_spfi_driver = { .driver = { .name = "img-spfi", - .pm = &img_spfi_pm_ops, + .pm = pm_ptr(&img_spfi_pm_ops), .of_match_table = of_match_ptr(img_spfi_of_match), }, .probe = img_spfi_probe,