summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-rpc-if.c
diff options
context:
space:
mode:
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>2020-12-30 15:57:08 +0100
committerMark Brown <broonie@kernel.org>2020-12-31 13:46:31 +0100
commit9584fc95cadc0b86e5e01cefcff0ab2b31ee3a5b (patch)
tree901e0987529269955040763042313ab7f290d375 /drivers/spi/spi-rpc-if.c
parentspi: dt-bindings: document zero value for spi-{rx,tx}-bus-width properties (diff)
downloadlinux-9584fc95cadc0b86e5e01cefcff0ab2b31ee3a5b.tar.xz
linux-9584fc95cadc0b86e5e01cefcff0ab2b31ee3a5b.zip
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: Pavel Machek <pavel@denx.de> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Acked-by: Pavel Machek <pavel@denx.de> Link: https://lore.kernel.org/r/20201230145708.28544-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-rpc-if.c')
-rw-r--r--drivers/spi/spi-rpc-if.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c
index 3579675485a5..c313dbe6185c 100644
--- a/drivers/spi/spi-rpc-if.c
+++ b/drivers/spi/spi-rpc-if.c
@@ -176,15 +176,14 @@ static int rpcif_spi_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int rpcif_spi_suspend(struct device *dev)
+static int __maybe_unused rpcif_spi_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
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);
@@ -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);
-#define DEV_PM_OPS (&rpcif_spi_pm_ops)
-#else
-#define DEV_PM_OPS NULL
-#endif
static struct platform_driver rpcif_spi_driver = {
.probe = rpcif_spi_probe,
.remove = rpcif_spi_remove,
.driver = {
.name = "rpc-if-spi",
- .pm = DEV_PM_OPS,
+ .pm = &rpcif_spi_pm_ops,
},
};
module_platform_driver(rpcif_spi_driver);