* [PATCH] i2c: imx-lpi2c: Use __maybe_unused instead of #if CONFIG_PM_SLEEP
@ 2019-04-30 7:00 Anson Huang
2019-04-30 8:10 ` Aisheng Dong
2019-05-03 14:52 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Anson Huang @ 2019-04-30 7:00 UTC (permalink / raw)
To: Aisheng Dong, shawnguo@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com,
linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: dl-linux-imx
Use __maybe_unused for power management related functions
instead of #if CONFIG_PM_SLEEP to simply the code.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
drivers/i2c/busses/i2c-imx-lpi2c.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index 06c4c76..dc00fab 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -639,8 +639,7 @@ static int lpi2c_imx_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int lpi2c_runtime_suspend(struct device *dev)
+static int __maybe_unused lpi2c_runtime_suspend(struct device *dev)
{
struct lpi2c_imx_struct *lpi2c_imx = dev_get_drvdata(dev);
@@ -650,7 +649,7 @@ static int lpi2c_runtime_suspend(struct device *dev)
return 0;
}
-static int lpi2c_runtime_resume(struct device *dev)
+static int __maybe_unused lpi2c_runtime_resume(struct device *dev)
{
struct lpi2c_imx_struct *lpi2c_imx = dev_get_drvdata(dev);
int ret;
@@ -671,10 +670,6 @@ static const struct dev_pm_ops lpi2c_pm_ops = {
SET_RUNTIME_PM_OPS(lpi2c_runtime_suspend,
lpi2c_runtime_resume, NULL)
};
-#define IMX_LPI2C_PM (&lpi2c_pm_ops)
-#else
-#define IMX_LPI2C_PM NULL
-#endif
static struct platform_driver lpi2c_imx_driver = {
.probe = lpi2c_imx_probe,
@@ -682,7 +677,7 @@ static struct platform_driver lpi2c_imx_driver = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = lpi2c_imx_of_match,
- .pm = IMX_LPI2C_PM,
+ .pm = &lpi2c_pm_ops,
},
};
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] i2c: imx-lpi2c: Use __maybe_unused instead of #if CONFIG_PM_SLEEP
2019-04-30 7:00 [PATCH] i2c: imx-lpi2c: Use __maybe_unused instead of #if CONFIG_PM_SLEEP Anson Huang
@ 2019-04-30 8:10 ` Aisheng Dong
2019-05-03 14:52 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Aisheng Dong @ 2019-04-30 8:10 UTC (permalink / raw)
To: Anson Huang, shawnguo@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com,
linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: dl-linux-imx
> From: Anson Huang
> Sent: Tuesday, April 30, 2019 3:00 PM
> Subject: [PATCH] i2c: imx-lpi2c: Use __maybe_unused instead of #if
> CONFIG_PM_SLEEP
>
> Use __maybe_unused for power management related functions instead of #if
> CONFIG_PM_SLEEP to simply the code.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Regards
Dong Aisheng
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: imx-lpi2c: Use __maybe_unused instead of #if CONFIG_PM_SLEEP
2019-04-30 7:00 [PATCH] i2c: imx-lpi2c: Use __maybe_unused instead of #if CONFIG_PM_SLEEP Anson Huang
2019-04-30 8:10 ` Aisheng Dong
@ 2019-05-03 14:52 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2019-05-03 14:52 UTC (permalink / raw)
To: Anson Huang
Cc: Aisheng Dong, shawnguo@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com,
linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, dl-linux-imx
[-- Attachment #1: Type: text/plain, Size: 267 bytes --]
On Tue, Apr 30, 2019 at 07:00:02AM +0000, Anson Huang wrote:
> Use __maybe_unused for power management related functions
> instead of #if CONFIG_PM_SLEEP to simply the code.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-03 14:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-30 7:00 [PATCH] i2c: imx-lpi2c: Use __maybe_unused instead of #if CONFIG_PM_SLEEP Anson Huang
2019-04-30 8:10 ` Aisheng Dong
2019-05-03 14:52 ` Wolfram Sang
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).