Skip to content

Commit

Permalink
tty: xuartps: Fix build error due to missing forward declaration
Browse files Browse the repository at this point in the history
If CONFIG_PM_SLEEP is enabled and CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
is not, a forward declaration of the uart_driver struct is not
included, leading to a build error due to an undeclared variable.
Fixing this by moving the definition of the struct uart_driver before
the definition of the suspend/resume callbacks.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Soren Brinkmann authored and Greg Kroah-Hartman committed Oct 29, 2013
1 parent d54b181 commit d3641f6
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions drivers/tty/serial/xilinx_uartps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,20 @@ console_initcall(xuartps_console_init);

#endif /* CONFIG_SERIAL_XILINX_PS_UART_CONSOLE */

/** Structure Definitions
*/
static struct uart_driver xuartps_uart_driver = {
.owner = THIS_MODULE, /* Owner */
.driver_name = XUARTPS_NAME, /* Driver name */
.dev_name = XUARTPS_TTY_NAME, /* Node name */
.major = XUARTPS_MAJOR, /* Major number */
.minor = XUARTPS_MINOR, /* Minor number */
.nr = XUARTPS_NR_PORTS, /* Number of UART ports */
#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
.cons = &xuartps_console, /* Console */
#endif
};

#ifdef CONFIG_PM_SLEEP
/**
* xuartps_suspend - suspend event
Expand Down Expand Up @@ -1311,20 +1325,6 @@ static int xuartps_resume(struct device *device)

static SIMPLE_DEV_PM_OPS(xuartps_dev_pm_ops, xuartps_suspend, xuartps_resume);

/** Structure Definitions
*/
static struct uart_driver xuartps_uart_driver = {
.owner = THIS_MODULE, /* Owner */
.driver_name = XUARTPS_NAME, /* Driver name */
.dev_name = XUARTPS_TTY_NAME, /* Node name */
.major = XUARTPS_MAJOR, /* Major number */
.minor = XUARTPS_MINOR, /* Minor number */
.nr = XUARTPS_NR_PORTS, /* Number of UART ports */
#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
.cons = &xuartps_console, /* Console */
#endif
};

/* ---------------------------------------------------------------------
* Platform bus binding
*/
Expand Down

0 comments on commit d3641f6

Please sign in to comment.