summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/operation.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-01-19 12:51:02 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-01-19 12:12:40 -0800
commitbfa9a5e2d07937a7620d55ff6eb55b480bc13100 (patch)
tree735273bfafedadaf0ccce030267e2778a79db607 /drivers/staging/greybus/operation.c
parent1cbfab3804b185ce2744b5b8064d06ca19491e36 (diff)
greybus: connection: add per-connection request handlers
Add a connection request-handler field to struct gb_connection that is set when the connection is enabled. This is a step towards removing the legacy protocol abstraction from core, and will also be used to implement unidirectional connection states (e.g. only outgoing operations are allowed). Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/operation.c')
-rw-r--r--drivers/staging/greybus/operation.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c
index ae3ada0b54e3..4dc79cb12397 100644
--- a/drivers/staging/greybus/operation.c
+++ b/drivers/staging/greybus/operation.c
@@ -218,15 +218,11 @@ static void gb_message_cancel(struct gb_message *message)
static void gb_operation_request_handle(struct gb_operation *operation)
{
struct gb_connection *connection = operation->connection;
- struct gb_protocol *protocol = connection->protocol;
int status;
int ret;
- if (!protocol)
- return;
-
- if (protocol->request_recv) {
- status = protocol->request_recv(operation->type, operation);
+ if (connection->handler) {
+ status = connection->handler(operation);
} else {
dev_err(&connection->hd->dev,
"%s: unexpected incoming request of type 0x%02x\n",