Skip to content

Commit

Permalink
tty: serial: qcom_geni_serial: Initialize console port statically
Browse files Browse the repository at this point in the history
Perform static initialization of console_port since its initial state has
no run-time dependencies.

Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Karthikeyan Ramasubramanian authored and Greg Kroah-Hartman committed May 14, 2018
1 parent 8e70c47 commit f737175
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions drivers/tty/serial/qcom_geni_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct qcom_geni_serial_port {
bool brk;
};

static const struct uart_ops qcom_geni_serial_pops;
static const struct uart_ops qcom_geni_console_pops;
static struct uart_driver qcom_geni_console_driver;
static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop);
static unsigned int qcom_geni_serial_tx_empty(struct uart_port *port);
Expand All @@ -118,7 +118,14 @@ static const unsigned long root_freq[] = {7372800, 14745600, 19200000, 29491200,
#define to_dev_port(ptr, member) \
container_of(ptr, struct qcom_geni_serial_port, member)

static struct qcom_geni_serial_port qcom_geni_console_port;
static struct qcom_geni_serial_port qcom_geni_console_port = {
.uport = {
.iotype = UPIO_MEM,
.ops = &qcom_geni_console_pops,
.flags = UPF_BOOT_AUTOCONF,
.line = 0,
},
};

static int qcom_geni_serial_request_port(struct uart_port *uport)
{
Expand Down Expand Up @@ -1130,11 +1137,6 @@ static int __init qcom_geni_serial_init(void)
{
int ret;

qcom_geni_console_port.uport.iotype = UPIO_MEM;
qcom_geni_console_port.uport.ops = &qcom_geni_console_pops;
qcom_geni_console_port.uport.flags = UPF_BOOT_AUTOCONF;
qcom_geni_console_port.uport.line = 0;

ret = console_register(&qcom_geni_console_driver);
if (ret)
return ret;
Expand Down

0 comments on commit f737175

Please sign in to comment.