Commit 9584fc95 authored by Lad Prabhakar's avatar Lad Prabhakar Committed by Mark Brown

spi: rpc-if: Remove CONFIG_PM_SLEEP ifdefery

Use __maybe_unused for the suspend()/resume() hooks and get rid of
the CONFIG_PM_SLEEP ifdefery to improve the code.
Suggested-by: default avatarPavel Machek <pavel@denx.de>
Signed-off-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: default avatarPavel Machek <pavel@denx.de>
Link: https://lore.kernel.org/r/20201230145708.28544-3-prabhakar.mahadev-lad.rj@bp.renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ffe9819b
...@@ -176,15 +176,14 @@ static int rpcif_spi_remove(struct platform_device *pdev) ...@@ -176,15 +176,14 @@ static int rpcif_spi_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP 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); struct spi_controller *ctlr = dev_get_drvdata(dev);
return spi_controller_suspend(ctlr); return spi_controller_suspend(ctlr);
} }
static int rpcif_spi_resume(struct device *dev) static int __maybe_unused rpcif_spi_resume(struct device *dev)
{ {
struct spi_controller *ctlr = dev_get_drvdata(dev); struct spi_controller *ctlr = dev_get_drvdata(dev);
...@@ -192,17 +191,13 @@ static int rpcif_spi_resume(struct device *dev) ...@@ -192,17 +191,13 @@ static int rpcif_spi_resume(struct device *dev)
} }
static SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume); static SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume);
#define DEV_PM_OPS (&rpcif_spi_pm_ops)
#else
#define DEV_PM_OPS NULL
#endif
static struct platform_driver rpcif_spi_driver = { static struct platform_driver rpcif_spi_driver = {
.probe = rpcif_spi_probe, .probe = rpcif_spi_probe,
.remove = rpcif_spi_remove, .remove = rpcif_spi_remove,
.driver = { .driver = {
.name = "rpc-if-spi", .name = "rpc-if-spi",
.pm = DEV_PM_OPS, .pm = &rpcif_spi_pm_ops,
}, },
}; };
module_platform_driver(rpcif_spi_driver); module_platform_driver(rpcif_spi_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment