mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
spi: spi-fsl-dspi: use modern PM macros
Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Link: https://patch.msgid.link/20260803142003.12857-13-jszhang@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
65172b5d38
commit
cda6ef242a
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user