Skip to content

Commit

Permalink
spi: rpc-if: Remove CONFIG_PM_SLEEP ifdefery
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lad Prabhakar authored and Mark Brown committed Dec 31, 2020
1 parent ffe9819 commit 9584fc9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drivers/spi/spi-rpc-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,33 +176,28 @@ 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);

return spi_controller_resume(ctlr);
}

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);
Expand Down

0 comments on commit 9584fc9

Please sign in to comment.