[PATCH v3] MIPS: Alchemy: fix build with SERIAL_8250=n

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In commit 7d172bfe ("Alchemy: Add UART PM methods") I introduced
platform PM methods which call a function of the 8250 driver;
this patch works around link failures when the kernel is built
without 8250 support.

Signed-off-by: Manuel Lauss <manuel.lauss@xxxxxxxxxxxxxx>
---
Run-tested on DB1200.

v3: account for modular 8250 code.
v2: added commit name to patch description as per Sergei's suggestion.

 arch/mips/alchemy/common/platform.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
index 3691630..66ca7c5 100644
--- a/arch/mips/alchemy/common/platform.c
+++ b/arch/mips/alchemy/common/platform.c
@@ -27,6 +27,12 @@
 static void alchemy_8250_pm(struct uart_port *port, unsigned int state,
 			    unsigned int old_state)
 {
+	/* account for 8250.c built as module.  This code can only be called
+	 * by 8250.c so symbol_get should never fail.
+	 */
+	void(*pm_func)(struct uart_port *, unsigned int, unsigned int);
+	pm_func = symbol_get(serial8250_do_pm);
+
 	switch (state) {
 	case 0:
 		if ((__raw_readl(port->membase + UART_MOD_CNTRL) & 3) != 3) {
@@ -38,17 +44,19 @@ static void alchemy_8250_pm(struct uart_port *port, unsigned int state,
 		}
 		__raw_writel(3, port->membase + UART_MOD_CNTRL); /* full on */
 		wmb();
-		serial8250_do_pm(port, state, old_state);
+		pm_func(port, state, old_state);
 		break;
 	case 3:		/* power off */
-		serial8250_do_pm(port, state, old_state);
+		pm_func(port, state, old_state);
 		__raw_writel(0, port->membase + UART_MOD_CNTRL);
 		wmb();
 		break;
 	default:
-		serial8250_do_pm(port, state, old_state);
+		pm_func(port, state, old_state);
 		break;
 	}
+
+	symbol_put(pm_func);
 }
 
 #define PORT(_base, _irq)					\
-- 
1.7.3.3




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux