All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
@ 2019-05-05  3:31 ` Anson Huang
  0 siblings, 0 replies; 9+ messages in thread
From: Anson Huang @ 2019-05-05  3:31 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, wsa+renesas,
	u.kleine-koenig, eha, linux, Laurentiu Tudor, peda, linux-i2c,
	linux-arm-kernel, linux-kernel
  Cc: dl-linux-imx

Use __maybe_unused for runtime PM related functions instead
of #if CONFIG_PM to simply the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/i2c/busses/i2c-imx.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index fd70b11..b1b8b93 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1220,8 +1220,7 @@ static int i2c_imx_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int i2c_imx_runtime_suspend(struct device *dev)
+static int __maybe_unused i2c_imx_runtime_suspend(struct device *dev)
 {
 	struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
 
@@ -1230,7 +1229,7 @@ static int i2c_imx_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int i2c_imx_runtime_resume(struct device *dev)
+static int __maybe_unused i2c_imx_runtime_resume(struct device *dev)
 {
 	struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
 	int ret;
@@ -1246,17 +1245,13 @@ static const struct dev_pm_ops i2c_imx_pm_ops = {
 	SET_RUNTIME_PM_OPS(i2c_imx_runtime_suspend,
 			   i2c_imx_runtime_resume, NULL)
 };
-#define I2C_IMX_PM_OPS (&i2c_imx_pm_ops)
-#else
-#define I2C_IMX_PM_OPS NULL
-#endif /* CONFIG_PM */
 
 static struct platform_driver i2c_imx_driver = {
 	.probe = i2c_imx_probe,
 	.remove = i2c_imx_remove,
 	.driver = {
 		.name = DRIVER_NAME,
-		.pm = I2C_IMX_PM_OPS,
+		.pm = &i2c_imx_pm_ops,
 		.of_match_table = i2c_imx_dt_ids,
 	},
 	.id_table = imx_i2c_devtype,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
@ 2019-05-05  3:31 ` Anson Huang
  0 siblings, 0 replies; 9+ messages in thread
From: Anson Huang @ 2019-05-05  3:31 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, wsa+renesas,
	u.kleine-koenig, eha, linux, Laurentiu Tudor, peda, linux-i2c,
	linux-arm-kernel, linux-kernel
  Cc: dl-linux-imx

Use __maybe_unused for runtime PM related functions instead
of #if CONFIG_PM to simply the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/i2c/busses/i2c-imx.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index fd70b11..b1b8b93 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1220,8 +1220,7 @@ static int i2c_imx_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int i2c_imx_runtime_suspend(struct device *dev)
+static int __maybe_unused i2c_imx_runtime_suspend(struct device *dev)
 {
 	struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
 
@@ -1230,7 +1229,7 @@ static int i2c_imx_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int i2c_imx_runtime_resume(struct device *dev)
+static int __maybe_unused i2c_imx_runtime_resume(struct device *dev)
 {
 	struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
 	int ret;
@@ -1246,17 +1245,13 @@ static const struct dev_pm_ops i2c_imx_pm_ops = {
 	SET_RUNTIME_PM_OPS(i2c_imx_runtime_suspend,
 			   i2c_imx_runtime_resume, NULL)
 };
-#define I2C_IMX_PM_OPS (&i2c_imx_pm_ops)
-#else
-#define I2C_IMX_PM_OPS NULL
-#endif /* CONFIG_PM */
 
 static struct platform_driver i2c_imx_driver = {
 	.probe = i2c_imx_probe,
 	.remove = i2c_imx_remove,
 	.driver = {
 		.name = DRIVER_NAME,
-		.pm = I2C_IMX_PM_OPS,
+		.pm = &i2c_imx_pm_ops,
 		.of_match_table = i2c_imx_dt_ids,
 	},
 	.id_table = imx_i2c_devtype,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
@ 2019-05-05  3:31 ` Anson Huang
  0 siblings, 0 replies; 9+ messages in thread
From: Anson Huang @ 2019-05-05  3:31 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, wsa+renesas,
	u.kleine-koenig, eha, linux, Laurentiu Tudor, peda, linux-i2c,
	linux-arm-kernel, linux-kernel
  Cc: dl-linux-imx

Use __maybe_unused for runtime PM related functions instead
of #if CONFIG_PM to simply the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/i2c/busses/i2c-imx.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index fd70b11..b1b8b93 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1220,8 +1220,7 @@ static int i2c_imx_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int i2c_imx_runtime_suspend(struct device *dev)
+static int __maybe_unused i2c_imx_runtime_suspend(struct device *dev)
 {
 	struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
 
@@ -1230,7 +1229,7 @@ static int i2c_imx_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int i2c_imx_runtime_resume(struct device *dev)
+static int __maybe_unused i2c_imx_runtime_resume(struct device *dev)
 {
 	struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
 	int ret;
@@ -1246,17 +1245,13 @@ static const struct dev_pm_ops i2c_imx_pm_ops = {
 	SET_RUNTIME_PM_OPS(i2c_imx_runtime_suspend,
 			   i2c_imx_runtime_resume, NULL)
 };
-#define I2C_IMX_PM_OPS (&i2c_imx_pm_ops)
-#else
-#define I2C_IMX_PM_OPS NULL
-#endif /* CONFIG_PM */
 
 static struct platform_driver i2c_imx_driver = {
 	.probe = i2c_imx_probe,
 	.remove = i2c_imx_remove,
 	.driver = {
 		.name = DRIVER_NAME,
-		.pm = I2C_IMX_PM_OPS,
+		.pm = &i2c_imx_pm_ops,
 		.of_match_table = i2c_imx_dt_ids,
 	},
 	.id_table = imx_i2c_devtype,
-- 
2.7.4

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
  2019-05-05  3:31 ` Anson Huang
  (?)
@ 2019-05-05  7:31   ` Aisheng Dong
  -1 siblings, 0 replies; 9+ messages in thread
From: Aisheng Dong @ 2019-05-05  7:31 UTC (permalink / raw)
  To: Anson Huang, shawnguo, s.hauer, kernel, festevam, wsa+renesas,
	u.kleine-koenig, eha, linux, Laurentiu Tudor, peda, linux-i2c,
	linux-arm-kernel, linux-kernel
  Cc: dl-linux-imx

> From: Anson Huang
> Sent: Sunday, May 5, 2019 11:32 AM
> Subject: [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
> 
> Use __maybe_unused for runtime PM related functions instead of #if
> CONFIG_PM to simply the code.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>

Regards
Dong Aisheng

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
@ 2019-05-05  7:31   ` Aisheng Dong
  0 siblings, 0 replies; 9+ messages in thread
From: Aisheng Dong @ 2019-05-05  7:31 UTC (permalink / raw)
  To: Anson Huang, shawnguo, s.hauer, kernel, festevam, wsa+renesas,
	u.kleine-koenig, eha, linux, Laurentiu Tudor, peda, linux-i2c,
	linux-arm-kernel, linux-kernel
  Cc: dl-linux-imx

> From: Anson Huang
> Sent: Sunday, May 5, 2019 11:32 AM
> Subject: [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
> 
> Use __maybe_unused for runtime PM related functions instead of #if
> CONFIG_PM to simply the code.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>

Regards
Dong Aisheng

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
@ 2019-05-05  7:31   ` Aisheng Dong
  0 siblings, 0 replies; 9+ messages in thread
From: Aisheng Dong @ 2019-05-05  7:31 UTC (permalink / raw)
  To: Anson Huang, shawnguo, s.hauer, kernel, festevam, wsa+renesas,
	u.kleine-koenig, eha, linux, Laurentiu Tudor, peda, linux-i2c,
	linux-arm-kernel, linux-kernel
  Cc: dl-linux-imx

> From: Anson Huang
> Sent: Sunday, May 5, 2019 11:32 AM
> Subject: [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
> 
> Use __maybe_unused for runtime PM related functions instead of #if
> CONFIG_PM to simply the code.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>

Regards
Dong Aisheng
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
  2019-05-05  3:31 ` Anson Huang
  (?)
@ 2019-05-27 19:06   ` Wolfram Sang
  -1 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-05-27 19:06 UTC (permalink / raw)
  To: Anson Huang
  Cc: shawnguo, s.hauer, kernel, festevam, wsa+renesas,
	u.kleine-koenig, eha, linux, Laurentiu Tudor, peda, linux-i2c,
	linux-arm-kernel, linux-kernel, dl-linux-imx

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

On Sun, May 05, 2019 at 03:31:55AM +0000, Anson Huang wrote:
> Use __maybe_unused for runtime PM related functions instead
> of #if CONFIG_PM 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] 9+ messages in thread

* Re: [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
@ 2019-05-27 19:06   ` Wolfram Sang
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-05-27 19:06 UTC (permalink / raw)
  To: Anson Huang
  Cc: shawnguo, s.hauer, kernel, festevam, wsa+renesas,
	u.kleine-koenig, eha, linux, Laurentiu Tudor, peda, linux-i2c,
	linux-arm-kernel, linux-kernel, dl-linux-imx

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

On Sun, May 05, 2019 at 03:31:55AM +0000, Anson Huang wrote:
> Use __maybe_unused for runtime PM related functions instead
> of #if CONFIG_PM 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] 9+ messages in thread

* Re: [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
@ 2019-05-27 19:06   ` Wolfram Sang
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-05-27 19:06 UTC (permalink / raw)
  To: Anson Huang
  Cc: eha, shawnguo, s.hauer, linux-kernel, linux, wsa+renesas,
	linux-i2c, kernel, u.kleine-koenig, dl-linux-imx, festevam, peda,
	linux-arm-kernel, Laurentiu Tudor


[-- Attachment #1.1: Type: text/plain, Size: 255 bytes --]

On Sun, May 05, 2019 at 03:31:55AM +0000, Anson Huang wrote:
> Use __maybe_unused for runtime PM related functions instead
> of #if CONFIG_PM to simply the code.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied to for-next, thanks!


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-05-27 19:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-05  3:31 [PATCH] i2c: imx: Use __maybe_unused instead of #if CONFIG_PM Anson Huang
2019-05-05  3:31 ` Anson Huang
2019-05-05  3:31 ` Anson Huang
2019-05-05  7:31 ` Aisheng Dong
2019-05-05  7:31   ` Aisheng Dong
2019-05-05  7:31   ` Aisheng Dong
2019-05-27 19:06 ` Wolfram Sang
2019-05-27 19:06   ` Wolfram Sang
2019-05-27 19:06   ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.