summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.c
diff options
context:
space:
mode:
authorJohan Hovold2015-07-14 15:43:35 +0200
committerGreg Kroah-Hartman2015-07-15 21:39:13 +0200
commit5a3be769e92ea993f8a8c27b89571c276d874733 (patch)
tree72a61b98fa4272814d2cce4859abe9e30bf3220b /drivers/staging/greybus/connection.c
parentgreybus: operation: fix response-cancellation race (diff)
downloadkernel-qcow2-linux-5a3be769e92ea993f8a8c27b89571c276d874733.tar.gz
kernel-qcow2-linux-5a3be769e92ea993f8a8c27b89571c276d874733.tar.xz
kernel-qcow2-linux-5a3be769e92ea993f8a8c27b89571c276d874733.zip
greybus: operation: split incoming and outgoing cancellation
Split incoming and outgoing operation-cancellation helpers. Incoming operations are only cancelled as part of connection tear down and is specifically not needed in the driver API. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.c')
-rw-r--r--drivers/staging/greybus/connection.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c
index ac9b2d174805..81a5df0e3230 100644
--- a/drivers/staging/greybus/connection.c
+++ b/drivers/staging/greybus/connection.c
@@ -238,7 +238,11 @@ static void gb_connection_cancel_operations(struct gb_connection *connection,
gb_operation_get(operation);
spin_unlock_irq(&connection->lock);
- gb_operation_cancel(operation, errno);
+ if (gb_operation_is_incoming(operation))
+ gb_operation_cancel_incoming(operation, errno);
+ else
+ gb_operation_cancel(operation, errno);
+
gb_operation_put(operation);
spin_lock_irq(&connection->lock);