Skip to contentSkip to conversation

serial: imx: Fix warning when !CONFIG_SERIAL_IMX_CONSOLE

PATCH Superseded Fabio Estevam 2 participants 4 messages Jun 4, 2013

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/3 serial: imx: Fix warning when !CONFIG_SERIAL_IMX_CONSOLE

From: Fabio Estevam <[email protected]>

When CONFIG_SERIAL_IMX_CONSOLE is not selected the following build warnings appear:

drivers/tty/serial/imx.c:274:13: warning: 'imx_port_ucrs_save' defined but not used [-Wunused-function] drivers/tty/serial/imx.c:283:13: warning: 'imx_port_ucrs_restore' defined but not used [-Wunused-function]

imx_port_ucrs_save() and imx_port_ucrs_restore() are only used when CONFIG_CONSOLE_POLL or CONFIG_SERIAL_IMX_CONSOLE are selected, so protect these functions declaration with a proper ifdef.

---
 drivers/tty/serial/imx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/tty/serial/imx.c +2 -0
index 72bc1db..90eba78 100644
@@ -271,6 +271,7 @@ static inline int is_imx21_uart(struct imx_port *sport)
 /*
  * Save and restore functions for UCR1, UCR2 and UCR3 registers
  */
+#if defined(CONFIG_CONSOLE_POLL) || defined(CONFIG_SERIAL_IMX_CONSOLE)
 static void imx_port_ucrs_save(struct uart_port *port,
 			       struct imx_port_ucrs *ucr)
 {
@@ -288,6 +289,7 @@ static void imx_port_ucrs_restore(struct uart_port *port,
 	writel(ucr->ucr2, port->membase + UCR2);
 	writel(ucr->ucr3, port->membase + UCR3);
 }
+#endif
 
 /*
  * Handle any change of modem status signal since we were last called.
Signature · 1 line
1.8.1.2
author reviewer
#1 lore raw

PATCH 2/3 serial: imx: Allow module build

From: Fabio Estevam <[email protected]>

There is no need to only allow the serial driver to be built-in.

Allow the imx serial driver to be build as a module.

---
 drivers/tty/serial/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/Kconfig +2 -2
index 7e7006f..bfe9ad8 100644
@@ -551,7 +551,7 @@ config BFIN_UART3_CTSRTS
 	  Enable hardware flow control in the driver.
 
 config SERIAL_IMX
-	bool "IMX serial port support"
+	tristate "IMX serial port support"
 	depends on ARCH_MXC
 	select SERIAL_CORE
 	select RATIONAL
@@ -560,7 +560,7 @@ config SERIAL_IMX
 	  can enable its onboard serial port by enabling this option.
 
 config SERIAL_IMX_CONSOLE
-	bool "Console on IMX serial port"
+	tristate "Console on IMX serial port"
 	depends on SERIAL_IMX
 	select SERIAL_CORE_CONSOLE
 	help
Signature · 1 line
1.8.1.2
author reviewer
#2 lore raw

PATCH 3/3 serial: imx: Improve Kconfig text

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

Some improvements in the Kconfig text:

- Vendor is Freescale now
- Provide a better example for the console parameter, which is something like console=ttymxc0
- Do not pass the names of ancient bootloaders

---
 drivers/tty/serial/Kconfig | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/tty/serial/Kconfig +3 -4
index bfe9ad8..f0a4a87 100644
@@ -564,15 +564,14 @@ config SERIAL_IMX_CONSOLE
 	depends on SERIAL_IMX
 	select SERIAL_CORE_CONSOLE
 	help
-	  If you have enabled the serial port on the Motorola IMX
+	  If you have enabled the serial port on the Freescale IMX
 	  CPU you can make it the console by answering Y to this option.
 
 	  Even if you say Y here, the currently visible virtual console
 	  (/dev/tty0) will still be used as the system console by default, but
 	  you can alter that using a kernel command line option such as
-	  "console=ttySA0". (Try "man bootparam" or see the documentation of
-	  your boot loader (lilo or loadlin) about how to pass options to the
-	  kernel at boot time.)
+	  "console=ttymxc0". (Try "man bootparam" or see the documentation of
+	  your bootloader about how to pass options to the kernel at boot time.)
 
 config SERIAL_UARTLITE
 	tristate "Xilinx uartlite serial port support"
Signature · 1 line
1.8.1.2
maintainer
#3 lore raw
In reply to Fabio Estevam
Quoted 4 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

When CONFIG_SERIAL_IMX_CONSOLE is not selected the following build warnings appear:

My take on this would be to remove CONFIG_SERIAL_IMX_CONSOLE completely and make it mandatory. I know traditionally console support is optional for all UART drivers, but is it really worth it to have these few bytes saved?

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |