Commit 9f240f20 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

greybus: uart-gb: clean up send_line_coding

We always pass the same option to send_line_coding() for the line_coding
structure, which is already in the struct gb_tty variable, so just
remove the second parameter as it's not needed.

This logic came from the cdc-acm.c driver, where it's also not needed
anymore, I'll go fix up that later on when I get a chance.
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent ecc25a7f
...@@ -180,12 +180,12 @@ static int send_data(struct gb_tty *tty, u16 size, const u8 *data) ...@@ -180,12 +180,12 @@ static int send_data(struct gb_tty *tty, u16 size, const u8 *data)
return retval; return retval;
} }
static int send_line_coding(struct gb_tty *tty, static int send_line_coding(struct gb_tty *tty)
struct gb_serial_line_coding *line_coding)
{ {
struct gb_uart_set_line_coding_request request; struct gb_uart_set_line_coding_request request;
memcpy(&request.line_coding, line_coding, sizeof(*line_coding)); memcpy(&request.line_coding, &tty->line_coding,
sizeof(tty->line_coding));
return gb_operation_sync(tty->connection, GB_UART_REQ_SET_LINE_CODING, return gb_operation_sync(tty->connection, GB_UART_REQ_SET_LINE_CODING,
&request, sizeof(request), NULL, 0); &request, sizeof(request), NULL, 0);
} }
...@@ -384,7 +384,7 @@ static void gb_tty_set_termios(struct tty_struct *tty, ...@@ -384,7 +384,7 @@ static void gb_tty_set_termios(struct tty_struct *tty,
if (memcpy(&gb_tty->line_coding, &newline, sizeof(newline))) { if (memcpy(&gb_tty->line_coding, &newline, sizeof(newline))) {
memcpy(&gb_tty->line_coding, &newline, sizeof(newline)); memcpy(&gb_tty->line_coding, &newline, sizeof(newline));
send_line_coding(gb_tty, &gb_tty->line_coding); send_line_coding(gb_tty);
} }
} }
...@@ -668,7 +668,7 @@ static int gb_uart_connection_init(struct gb_connection *connection) ...@@ -668,7 +668,7 @@ static int gb_uart_connection_init(struct gb_connection *connection)
gb_tty->line_coding.format = GB_SERIAL_1_STOP_BITS; gb_tty->line_coding.format = GB_SERIAL_1_STOP_BITS;
gb_tty->line_coding.parity = GB_SERIAL_NO_PARITY; gb_tty->line_coding.parity = GB_SERIAL_NO_PARITY;
gb_tty->line_coding.data = 8; gb_tty->line_coding.data = 8;
send_line_coding(gb_tty, &gb_tty->line_coding); send_line_coding(gb_tty);
tty_dev = tty_port_register_device(&gb_tty->port, gb_tty_driver, minor, tty_dev = tty_port_register_device(&gb_tty->port, gb_tty_driver, minor,
&connection->dev); &connection->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment