Blob Blame History Raw
From fe94347d6dc97e044db011010c55cb95367c23d0 Mon Sep 17 00:00:00 2001
From: Erwan Le Ray <erwan.leray@st.com>
Date: Thu, 13 Jun 2019 15:49:55 +0200
Subject: [PATCH] serial: stm32: Use __maybe_unused instead of #if CONFIG_PM_SLEEP
Git-commit: fe94347d6dc97e044db011010c55cb95367c23d0
Patch-mainline: v5.4-rc1
References: git-fixes

Use __maybe_unused for power management related functionsinstead of

Fixes: 270e5a74fe4c ("serial: stm32: add wakeup mechanism")
Signed-off-by: Erwan Le Ray <erwan.leray@st.com>

Link: https://lore.kernel.org/r/1560433800-12255-6-git-send-email-erwan.leray@st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/tty/serial/stm32-usart.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -1337,8 +1337,8 @@ static struct uart_driver stm32_usart_dr
 	.cons		= STM32_SERIAL_CONSOLE,
 };
 
-#ifdef CONFIG_PM_SLEEP
-static void stm32_serial_enable_wakeup(struct uart_port *port, bool enable)
+static void __maybe_unused stm32_serial_enable_wakeup(struct uart_port *port,
+						      bool enable)
 {
 	struct stm32_port *stm32_port = to_stm32_port(port);
 	struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
@@ -1362,7 +1362,7 @@ static void stm32_serial_enable_wakeup(s
 	}
 }
 
-static int stm32_serial_suspend(struct device *dev)
+static int __maybe_unused stm32_serial_suspend(struct device *dev)
 {
 	struct uart_port *port = dev_get_drvdata(dev);
 
@@ -1376,7 +1376,7 @@ static int stm32_serial_suspend(struct d
 	return 0;
 }
 
-static int stm32_serial_resume(struct device *dev)
+static int __maybe_unused stm32_serial_resume(struct device *dev)
 {
 	struct uart_port *port = dev_get_drvdata(dev);
 
@@ -1385,7 +1385,6 @@ static int stm32_serial_resume(struct de
 
 	return uart_resume_port(&stm32_usart_driver, port);
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static const struct dev_pm_ops stm32_serial_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(stm32_serial_suspend, stm32_serial_resume)