Skip to content

Commit

Permalink
serial: imx: Move imx_port_ucrs_save/restore under CONFIG_CONSOLE_POLL
Browse files Browse the repository at this point in the history
If CONFIG_CONSOLE_POLL is not defined, the following build warning happens:

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]

Move imx_port_ucrs_saver/restore under CONFIG_CONSOLE_POLL ifdef block to fix it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Fabio Estevam authored and Greg Kroah-Hartman committed Feb 5, 2013
1 parent b16ea4b commit cdc8da3
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions drivers/tty/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,27 +268,6 @@ static inline int is_imx21_uart(struct imx_port *sport)
return sport->devdata->devtype == IMX21_UART;
}

/*
* Save and restore functions for UCR1, UCR2 and UCR3 registers
*/
static void imx_port_ucrs_save(struct uart_port *port,
struct imx_port_ucrs *ucr)
{
/* save control registers */
ucr->ucr1 = readl(port->membase + UCR1);
ucr->ucr2 = readl(port->membase + UCR2);
ucr->ucr3 = readl(port->membase + UCR3);
}

static void imx_port_ucrs_restore(struct uart_port *port,
struct imx_port_ucrs *ucr)
{
/* restore control registers */
writel(ucr->ucr1, port->membase + UCR1);
writel(ucr->ucr2, port->membase + UCR2);
writel(ucr->ucr3, port->membase + UCR3);
}

/*
* Handle any change of modem status signal since we were last called.
*/
Expand Down Expand Up @@ -1103,6 +1082,27 @@ imx_verify_port(struct uart_port *port, struct serial_struct *ser)
}

#if defined(CONFIG_CONSOLE_POLL)
/*
* Save and restore functions for UCR1, UCR2 and UCR3 registers
*/
static void imx_port_ucrs_save(struct uart_port *port,
struct imx_port_ucrs *ucr)
{
/* save control registers */
ucr->ucr1 = readl(port->membase + UCR1);
ucr->ucr2 = readl(port->membase + UCR2);
ucr->ucr3 = readl(port->membase + UCR3);
}

static void imx_port_ucrs_restore(struct uart_port *port,
struct imx_port_ucrs *ucr)
{
/* restore control registers */
writel(ucr->ucr1, port->membase + UCR1);
writel(ucr->ucr2, port->membase + UCR2);
writel(ucr->ucr3, port->membase + UCR3);
}

static int imx_poll_get_char(struct uart_port *port)
{
struct imx_port_ucrs old_ucr;
Expand Down

0 comments on commit cdc8da3

Please sign in to comment.