OSDN Git Service

spi: bcm63xx: use macro DEFINE_SIMPLE_DEV_PM_OPS
authorDhruva Gole <d-gole@ti.com>
Mon, 24 Apr 2023 10:25:46 +0000 (15:55 +0530)
committerMark Brown <broonie@kernel.org>
Tue, 25 Apr 2023 15:55:45 +0000 (16:55 +0100)
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 = bcm63xx_spi_suspend, \
.resume = bcm63xx_spi_resume, \
.freeze = bcm63xx_spi_suspend, \
.thaw = bcm63xx_spi_resume, \
.poweroff = bcm63xx_spi_suspend, \
.restore = bcm63xx_spi_resume

Signed-off-by: Dhruva Gole <d-gole@ti.com>
Link: https://lore.kernel.org/r/20230424102546.1604484-1-d-gole@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bcm63xx.c

index 9939593..9aecb77 100644 (file)
@@ -644,9 +644,7 @@ static int bcm63xx_spi_resume(struct device *dev)
        return 0;
 }
 
-static const struct dev_pm_ops bcm63xx_spi_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(bcm63xx_spi_suspend, bcm63xx_spi_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(bcm63xx_spi_pm_ops, bcm63xx_spi_suspend, bcm63xx_spi_resume);
 
 static struct platform_driver bcm63xx_spi_driver = {
        .driver = {