greybus: uart: use the bundle struct device instead of the connector
authorGreg Kroah-Hartman <gregkh@google.com>
Wed, 14 Oct 2015 18:15:12 +0000 (11:15 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 15 Oct 2015 16:19:15 +0000 (09:19 -0700)
We are removing struct device from the gb_connection structure in the
near future.  The gb_bundle structure's struct device should be used as
a replacement.

This patch moves the uart driver to use the bundle pointer instead of
the connection pointer.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Reviewed-by: Alex Elder <elder@linaro.org>
drivers/staging/greybus/uart.c

index 9e8bf6f4b8d7936123817011b1540be8b7bd94c3..ec978a451b174f2cc6a2218de6831e110be73cec 100644 (file)
@@ -94,7 +94,7 @@ static int gb_uart_receive_data(struct gb_tty *gb_tty,
        count = tty_insert_flip_string_fixed_flag(port, receive_data->data,
                                                  tty_flags, recv_data_size);
        if (count != recv_data_size) {
-               dev_err(&connection->dev,
+               dev_err(&connection->bundle->dev,
                        "UART: RX 0x%08x bytes only wrote 0x%08x\n",
                        recv_data_size, count);
        }
@@ -121,7 +121,7 @@ static int gb_uart_request_recv(u8 type, struct gb_operation *op)
                gb_tty->ctrlin = serial_state->control;
                break;
        default:
-               dev_err(&connection->dev,
+               dev_err(&connection->bundle->dev,
                        "unsupported unsolicited request: %02x\n", type);
                ret = -EINVAL;
        }
@@ -175,7 +175,7 @@ static int send_break(struct gb_tty *gb_tty, u8 state)
        struct gb_uart_set_break_request request;
 
        if ((state != 0) && (state != 1)) {
-               dev_err(&gb_tty->connection->dev,
+               dev_err(&gb_tty->connection->bundle->dev,
                        "invalid break state of %d\n", state);
                return -EINVAL;
        }
@@ -626,7 +626,7 @@ static int gb_uart_connection_init(struct gb_connection *connection)
        minor = alloc_minor(gb_tty);
        if (minor < 0) {
                if (minor == -ENOSPC) {
-                       dev_err(&connection->dev,
+                       dev_err(&connection->bundle->dev,
                                "no more free minor numbers\n");
                        retval = -ENODEV;
                        goto error_minor;
@@ -654,7 +654,7 @@ static int gb_uart_connection_init(struct gb_connection *connection)
        send_line_coding(gb_tty);
 
        tty_dev = tty_port_register_device(&gb_tty->port, gb_tty_driver, minor,
-                                          &connection->dev);
+                                          &connection->bundle->dev);
        if (IS_ERR(tty_dev)) {
                retval = PTR_ERR(tty_dev);
                goto error;