Skip to contentSkip to conversation

tty: serial: fsl_lpuart: Use __maybe_unused instead of #if CONFIG_PM_SLEEP

PATCH In review Anson Huang 2 participants 2 messages May 15, 2020 – May 18, 2020 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: serial: fsl_lpuart: Use __maybe_unused instead of #if CONFIG_PM_SLEEP

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

---
 drivers/tty/serial/fsl_lpuart.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/fsl_lpuart.c +2 -4
index 6a9909e..cca485d 100644
@@ -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);
 
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines

From: Anson Huang <[email protected]>
Sent: Friday, May 15, 2020 8:58 PM

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

Regards
Aisheng

Quoted 38 lines
---
 drivers/tty/serial/fsl_lpuart.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/fsl_lpuart.c index renamed from drivers/tty/serial/fsl_lpuart.c +0 -0

6a9909e..cca485d 100644

drivers/tty/serial/fsl_lpuart.c +1 -2
@@ -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);
drivers/tty/serial/fsl_lpuart.c +1 -3
 	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