diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index c2d283876ef8..23e6bc5f202e 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -1460,7 +1460,6 @@ static int dspi_init(struct fsl_dspi *dspi) return 0; } -#ifdef CONFIG_PM_SLEEP static int dspi_suspend(struct device *dev) { struct fsl_dspi *dspi = dev_get_drvdata(dev); @@ -1515,9 +1514,8 @@ static int dspi_resume(struct device *dev) clk_disable_unprepare(dspi->clk); return ret; } -#endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume); static int dspi_target_abort(struct spi_controller *host) { @@ -1742,7 +1740,7 @@ static void dspi_shutdown(struct platform_device *pdev) static struct platform_driver fsl_dspi_driver = { .driver.name = DRIVER_NAME, .driver.of_match_table = fsl_dspi_dt_ids, - .driver.pm = &dspi_pm, + .driver.pm = pm_sleep_ptr(&dspi_pm), .probe = dspi_probe, .remove = dspi_remove, .shutdown = dspi_shutdown,