mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
spi: rpc-if: Drop deprecated SIMPLE_DEV_PM_OPS
Replace SIMPLE_DEV_PM_OPS->DEFINE_SIMPLE_DEV_PM_OPS macro and use pm_sleep_ptr(). This lets us drop the check for CONFIG_PM_SLEEP, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled, while increasing build coverage. Also drop the __maybe_unused attribute from PM functions. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://patch.msgid.link/20250921112649.104516-2-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
07e27ad163
commit
81ef2022b3
|
|
@ -196,21 +196,21 @@ static void rpcif_spi_remove(struct platform_device *pdev)
|
|||
pm_runtime_disable(rpc->dev);
|
||||
}
|
||||
|
||||
static int __maybe_unused rpcif_spi_suspend(struct device *dev)
|
||||
static int rpcif_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
|
||||
return spi_controller_suspend(ctlr);
|
||||
}
|
||||
|
||||
static int __maybe_unused rpcif_spi_resume(struct device *dev)
|
||||
static int rpcif_spi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
|
||||
return spi_controller_resume(ctlr);
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume);
|
||||
|
||||
static const struct platform_device_id rpc_if_spi_id_table[] = {
|
||||
{ .name = "rpc-if-spi" },
|
||||
|
|
@ -224,9 +224,7 @@ static struct platform_driver rpcif_spi_driver = {
|
|||
.id_table = rpc_if_spi_id_table,
|
||||
.driver = {
|
||||
.name = "rpc-if-spi",
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
.pm = &rpcif_spi_pm_ops,
|
||||
#endif
|
||||
.pm = pm_sleep_ptr(&rpcif_spi_pm_ops),
|
||||
},
|
||||
};
|
||||
module_platform_driver(rpcif_spi_driver);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user