Skip to content

Commit 3106db4

Browse files
geertubroonie
authored andcommitted
spi: sh-msiof: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Convert the Renesas SuperH MSIOF 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/108c136f2cab9aa8bc8ac90d14a05e66fb87deb0.1752087740.git.geert+renesas@glider.be Signed-off-by: Mark Brown <[email protected]>
1 parent 469d7ea commit 3106db4

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/spi/spi-sh-msiof.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,6 @@ static const struct platform_device_id spi_driver_ids[] = {
13201320
};
13211321
MODULE_DEVICE_TABLE(platform, spi_driver_ids);
13221322

1323-
#ifdef CONFIG_PM_SLEEP
13241323
static int sh_msiof_spi_suspend(struct device *dev)
13251324
{
13261325
struct sh_msiof_spi_priv *p = dev_get_drvdata(dev);
@@ -1335,20 +1334,16 @@ static int sh_msiof_spi_resume(struct device *dev)
13351334
return spi_controller_resume(p->ctlr);
13361335
}
13371336

1338-
static SIMPLE_DEV_PM_OPS(sh_msiof_spi_pm_ops, sh_msiof_spi_suspend,
1339-
sh_msiof_spi_resume);
1340-
#define DEV_PM_OPS (&sh_msiof_spi_pm_ops)
1341-
#else
1342-
#define DEV_PM_OPS NULL
1343-
#endif /* CONFIG_PM_SLEEP */
1337+
static DEFINE_SIMPLE_DEV_PM_OPS(sh_msiof_spi_pm_ops, sh_msiof_spi_suspend,
1338+
sh_msiof_spi_resume);
13441339

13451340
static struct platform_driver sh_msiof_spi_drv = {
13461341
.probe = sh_msiof_spi_probe,
13471342
.remove = sh_msiof_spi_remove,
13481343
.id_table = spi_driver_ids,
13491344
.driver = {
13501345
.name = "spi_sh_msiof",
1351-
.pm = DEV_PM_OPS,
1346+
.pm = pm_sleep_ptr(&sh_msiof_spi_pm_ops),
13521347
.of_match_table = of_match_ptr(sh_msiof_match),
13531348
},
13541349
};

0 commit comments

Comments
 (0)