From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
To: Mark Brown <broonie@kernel.org>, Jiri Kosina <trivial@kernel.org>,
Sergei Shtylyov <sergei.shtylyov@gmail.com>,
Pavel Machek <pavel@denx.de>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org,
Prabhakar <prabhakar.csengg@gmail.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: [PATCH 2/2] spi: rpc-if: Remove CONFIG_PM_SLEEP ifdefery
Date: Wed, 30 Dec 2020 14:57:08 +0000 [thread overview]
Message-ID: <20201230145708.28544-3-prabhakar.mahadev-lad.rj@bp.renesas.com> (raw)
In-Reply-To: <20201230145708.28544-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
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>
---
drivers/spi/spi-rpc-if.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c
index bf64da322e67..b600becd4691 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);
--
2.17.1
next prev parent reply other threads:[~2020-12-30 14:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-30 14:57 [PATCH 0/2] spi: rpc-if: Trivial fixes Lad Prabhakar
2020-12-30 14:57 ` [PATCH 1/2] spi: rpc-if: Avoid use of C++ style comments Lad Prabhakar
2020-12-30 16:27 ` Sergei Shtylyov
2020-12-30 23:16 ` Lad, Prabhakar
2020-12-30 14:57 ` Lad Prabhakar [this message]
2020-12-30 18:05 ` [PATCH 2/2] spi: rpc-if: Remove CONFIG_PM_SLEEP ifdefery Pavel Machek
2021-01-04 12:34 ` Geert Uytterhoeven
2021-01-04 21:25 ` Lad, Prabhakar
2021-01-04 21:30 ` Mark Brown
2021-01-04 23:40 ` Pavel Machek
2021-01-05 7:37 ` Geert Uytterhoeven
2021-01-05 10:42 ` Pavel Machek
2021-01-05 11:11 ` Geert Uytterhoeven
2020-12-31 13:29 ` (subset) [PATCH 0/2] spi: rpc-if: Trivial fixes Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201230145708.28544-3-prabhakar.mahadev-lad.rj@bp.renesas.com \
--to=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=pavel@denx.de \
--cc=prabhakar.csengg@gmail.com \
--cc=sergei.shtylyov@gmail.com \
--cc=trivial@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).