diff options
author | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2015-06-02 13:40:45 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-06-04 14:05:48 +0900 |
commit | 11fca140c92555f299808968061e81deb7c11821 (patch) | |
tree | 83abcc98f47b66091f1cd1055d6724ad2d087d23 /drivers/staging/greybus/uart.c | |
parent | 4ef53485c3d2d7a36c163c0409c8e3eb324a70d4 (diff) | |
download | op-kernel-dev-11fca140c92555f299808968061e81deb7c11821.zip op-kernel-dev-11fca140c92555f299808968061e81deb7c11821.tar.gz |
greybus: uart: Tidy naming convention to more closely match spec
Update tabs and naming of structures to match the naming used in the greybus
specification more closely.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/uart.c')
-rw-r--r-- | drivers/staging/greybus/uart.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index a4c0127..673eec4 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -33,6 +33,13 @@ #define GB_NUM_MINORS 255 /* 255 is enough for anyone... */ #define GB_NAME "ttyGB" +struct gb_tty_line_coding { + __le32 rate; + __u8 format; + __u8 parity; + __u8 data_bits; +}; + struct gb_tty { struct tty_port port; struct gb_connection *connection; @@ -50,10 +57,9 @@ struct gb_tty { u8 version_minor; unsigned int ctrlin; /* input control lines */ unsigned int ctrlout; /* output control lines */ - struct gb_serial_line_coding line_coding; + struct gb_tty_line_coding line_coding; }; - static struct tty_driver *gb_tty_driver; static DEFINE_IDR(tty_minors); static DEFINE_MUTEX(table_lock); @@ -87,7 +93,7 @@ static int send_line_coding(struct gb_tty *tty) { struct gb_uart_set_line_coding_request request; - memcpy(&request.line_coding, &tty->line_coding, + memcpy(&request, &tty->line_coding, sizeof(tty->line_coding)); return gb_operation_sync(tty->connection, GB_UART_TYPE_SET_LINE_CODING, &request, sizeof(request), NULL, 0); @@ -245,7 +251,7 @@ static void gb_tty_set_termios(struct tty_struct *tty, { struct gb_tty *gb_tty = tty->driver_data; struct ktermios *termios = &tty->termios; - struct gb_serial_line_coding newline; + struct gb_tty_line_coding newline; int newctrl = gb_tty->ctrlout; newline.rate = cpu_to_le32(tty_get_baud_rate(tty)); @@ -256,17 +262,17 @@ static void gb_tty_set_termios(struct tty_struct *tty, switch (termios->c_cflag & CSIZE) { case CS5: - newline.data = 5; + newline.data_bits = 5; break; case CS6: - newline.data = 6; + newline.data_bits = 6; break; case CS7: - newline.data = 7; + newline.data_bits = 7; break; case CS8: default: - newline.data = 8; + newline.data_bits = 8; break; } @@ -571,7 +577,7 @@ static int gb_uart_connection_init(struct gb_connection *connection) gb_tty->line_coding.rate = cpu_to_le32(9600); gb_tty->line_coding.format = GB_SERIAL_1_STOP_BITS; gb_tty->line_coding.parity = GB_SERIAL_NO_PARITY; - gb_tty->line_coding.data = 8; + gb_tty->line_coding.data_bits = 8; send_line_coding(gb_tty); tty_dev = tty_port_register_device(&gb_tty->port, gb_tty_driver, minor, |