linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty: serial: fsl_lpuart: Use __maybe_unused instead of #if CONFIG_PM_SLEEP
@ 2020-05-15 12:58 Anson Huang
  2020-05-18  3:43 ` Aisheng Dong
  0 siblings, 1 reply; 2+ messages in thread
From: Anson Huang @ 2020-05-15 12:58 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, linux-kernel; +Cc: Linux-imx

Use __maybe_unused for power management related functions to simplify
the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/tty/serial/fsl_lpuart.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 6a9909e..cca485d 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2662,8 +2662,7 @@ static int lpuart_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int lpuart_suspend(struct device *dev)
+static int __maybe_unused lpuart_suspend(struct device *dev)
 {
 	struct lpuart_port *sport = dev_get_drvdata(dev);
 	unsigned long temp;
@@ -2721,7 +2720,7 @@ static int lpuart_suspend(struct device *dev)
 	return 0;
 }
 
-static int lpuart_resume(struct device *dev)
+static int __maybe_unused lpuart_resume(struct device *dev)
 {
 	struct lpuart_port *sport = dev_get_drvdata(dev);
 	bool irq_wake = irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq));
@@ -2752,7 +2751,6 @@ static int lpuart_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static SIMPLE_DEV_PM_OPS(lpuart_pm_ops, lpuart_suspend, lpuart_resume);
 
-- 
2.7.4


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

* RE: [PATCH] tty: serial: fsl_lpuart: Use __maybe_unused instead of #if CONFIG_PM_SLEEP
  2020-05-15 12:58 [PATCH] tty: serial: fsl_lpuart: Use __maybe_unused instead of #if CONFIG_PM_SLEEP Anson Huang
@ 2020-05-18  3:43 ` Aisheng Dong
  0 siblings, 0 replies; 2+ messages in thread
From: Aisheng Dong @ 2020-05-18  3:43 UTC (permalink / raw)
  To: Anson Huang, gregkh, jslaby, linux-serial, linux-kernel; +Cc: dl-linux-imx

> From: Anson Huang <Anson.Huang@nxp.com>
> Sent: Friday, May 15, 2020 8:58 PM
> 
> Use __maybe_unused for power management related functions to simplify the
> code.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

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

Regards
Aisheng

> ---
>  drivers/tty/serial/fsl_lpuart.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index
> 6a9909e..cca485d 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -2662,8 +2662,7 @@ static int lpuart_remove(struct platform_device
> *pdev)
>  	return 0;
>  }
> 
> -#ifdef CONFIG_PM_SLEEP
> -static int lpuart_suspend(struct device *dev)
> +static int __maybe_unused lpuart_suspend(struct device *dev)
>  {
>  	struct lpuart_port *sport = dev_get_drvdata(dev);
>  	unsigned long temp;
> @@ -2721,7 +2720,7 @@ static int lpuart_suspend(struct device *dev)
>  	return 0;
>  }
> 
> -static int lpuart_resume(struct device *dev)
> +static int __maybe_unused lpuart_resume(struct device *dev)
>  {
>  	struct lpuart_port *sport = dev_get_drvdata(dev);
>  	bool irq_wake = irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq));
> @@ -2752,7 +2751,6 @@ static int lpuart_resume(struct device *dev)
> 
>  	return 0;
>  }
> -#endif
> 
>  static SIMPLE_DEV_PM_OPS(lpuart_pm_ops, lpuart_suspend, lpuart_resume);
> 
> --
> 2.7.4


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

end of thread, other threads:[~2020-05-18  3:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 12:58 [PATCH] tty: serial: fsl_lpuart: Use __maybe_unused instead of #if CONFIG_PM_SLEEP Anson Huang
2020-05-18  3:43 ` Aisheng Dong

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).