]> git.baikalelectronics.ru Git - kernel.git/commit
spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS
authorDhruva Gole <d-gole@ti.com>
Thu, 20 Apr 2023 05:42:57 +0000 (11:12 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:30 +0000 (23:03 +0900)
commit45789f38ab700284d4f5f35686ae8ba497b606e2
tree526eda438cda2185255f6e4d6d86887dcb183350
parentc3a121276dd243052dcc50b8cbda9110d9a317be
spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS

[ Upstream commit be3206e8906e7a93df673ab2e96d69304a008edc ]

Using this macro makes the code more readable.
It also inits the members of dev_pm_ops in the following manner
without us explicitly needing to:

.suspend = cqspi_suspend, \
.resume = cqspi_resume, \
.freeze = cqspi_suspend, \
.thaw = cqspi_resume, \
.poweroff = cqspi_suspend, \
.restore = cqspi_resume

Also get rid of conditional compilation based on CONFIG_PM_SLEEP because
it introduces build issues with certain configs when CQSPI_DEV_PM_OPS is
just NULL.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202304191900.2fARFQW9-lkp@intel.com/
Fixes: df54845e0034 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller")
Signed-off-by: Dhruva Gole <d-gole@ti.com>
Link: https://lore.kernel.org/r/20230420054257.925092-1-d-gole@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-cadence-quadspi.c