Skip to content

Commit 7d61715

Browse files
geertubroonie
authored andcommitted
spi: rspi: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Convert the Renesas RSPI/QSPI driver from SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(). This lets us drop the check for CONFIG_PM_SLEEP without impacting code size, while increasing build coverage. Signed-off-by: Geert Uytterhoeven <[email protected]> Link: https://patch.msgid.link/0b64c1c3803e6d3eeb3ae9cd8921d4fe67f37118.1752087701.git.geert+renesas@glider.be Signed-off-by: Mark Brown <[email protected]>
1 parent 3106db4 commit 7d61715

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/spi/spi-rspi.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,6 @@ static const struct platform_device_id spi_driver_ids[] = {
14041404

14051405
MODULE_DEVICE_TABLE(platform, spi_driver_ids);
14061406

1407-
#ifdef CONFIG_PM_SLEEP
14081407
static int rspi_suspend(struct device *dev)
14091408
{
14101409
struct rspi_data *rspi = dev_get_drvdata(dev);
@@ -1419,19 +1418,15 @@ static int rspi_resume(struct device *dev)
14191418
return spi_controller_resume(rspi->ctlr);
14201419
}
14211420

1422-
static SIMPLE_DEV_PM_OPS(rspi_pm_ops, rspi_suspend, rspi_resume);
1423-
#define DEV_PM_OPS &rspi_pm_ops
1424-
#else
1425-
#define DEV_PM_OPS NULL
1426-
#endif /* CONFIG_PM_SLEEP */
1421+
static DEFINE_SIMPLE_DEV_PM_OPS(rspi_pm_ops, rspi_suspend, rspi_resume);
14271422

14281423
static struct platform_driver rspi_driver = {
14291424
.probe = rspi_probe,
14301425
.remove = rspi_remove,
14311426
.id_table = spi_driver_ids,
14321427
.driver = {
14331428
.name = "renesas_spi",
1434-
.pm = DEV_PM_OPS,
1429+
.pm = pm_sleep_ptr(&rspi_pm_ops),
14351430
.of_match_table = of_match_ptr(rspi_of_match),
14361431
},
14371432
};

0 commit comments

Comments
 (0)