greybus: operation: clean up early connection-state check
authorJohan Hovold <johan@hovoldconsulting.com>
Fri, 27 May 2016 15:26:33 +0000 (17:26 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 27 May 2016 19:21:16 +0000 (12:21 -0700)
Now that the legacy invalid state is gone, clean up the early
connection-state check in the receive path and explicitly drop incoming
messages for disabled connection.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/operation.c

index 20a8d74..aaa1345 100644 (file)
@@ -968,8 +968,7 @@ void gb_connection_recv(struct gb_connection *connection,
        size_t msg_size;
        u16 operation_id;
 
-       if ((connection->state != GB_CONNECTION_STATE_ENABLED &&
-                       connection->state != GB_CONNECTION_STATE_ENABLED_TX) ||
+       if (connection->state == GB_CONNECTION_STATE_DISABLED ||
                        gb_connection_is_offloaded(connection)) {
                dev_warn_ratelimited(dev, "%s: dropping %zu received bytes\n",
                                connection->name, size);