Patch "spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS" has been added to the 6.3-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS

to the 6.3-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     spi-cadence-quadspi-use-macro-define_simple_dev_pm_o.patch
and it can be found in the queue-6.3 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c0694f3c8164d8753edbb62009498799ecb1dece
Author: Dhruva Gole <d-gole@xxxxxx>
Date:   Thu Apr 20 11:12:57 2023 +0530

    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@xxxxxxxxx>
    Link: https://lore.kernel.org/oe-kbuild-all/202304191900.2fARFQW9-lkp@xxxxxxxxx/
    Fixes: 140623410536 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller")
    Signed-off-by: Dhruva Gole <d-gole@xxxxxx>
    Link: https://lore.kernel.org/r/20230420054257.925092-1-d-gole@xxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index aab9d6a8ead90..6b49d9f650b8b 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1803,7 +1803,6 @@ static int cqspi_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int cqspi_suspend(struct device *dev)
 {
 	struct cqspi_st *cqspi = dev_get_drvdata(dev);
@@ -1833,15 +1832,7 @@ static int cqspi_resume(struct device *dev)
 	return spi_master_resume(master);
 }
 
-static const struct dev_pm_ops cqspi__dev_pm_ops = {
-	.suspend = cqspi_suspend,
-	.resume = cqspi_resume,
-};
-
-#define CQSPI_DEV_PM_OPS	(&cqspi__dev_pm_ops)
-#else
-#define CQSPI_DEV_PM_OPS	NULL
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(cqspi_dev_pm_ops, cqspi_suspend, cqspi_resume);
 
 static const struct cqspi_driver_platdata cdns_qspi = {
 	.quirks = CQSPI_DISABLE_DAC_MODE,
@@ -1908,7 +1899,7 @@ static struct platform_driver cqspi_platform_driver = {
 	.remove = cqspi_remove,
 	.driver = {
 		.name = CQSPI_NAME,
-		.pm = CQSPI_DEV_PM_OPS,
+		.pm = &cqspi_dev_pm_ops,
 		.of_match_table = cqspi_dt_ids,
 	},
 };



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux