]> git.karo-electronics.de Git - linux-beck.git/commitdiff
greybus: svc: store protocol version
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 19 Jan 2016 11:51:19 +0000 (12:51 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 19 Jan 2016 20:17:13 +0000 (12:17 -0800)
Store the "negotiated" protocol version to use in the svc state
struct instead of the connection struct.

The generic concept of a connection version is going away in favour of
bundle-class versions.

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>
drivers/staging/greybus/svc.c
drivers/staging/greybus/svc.h

index fcdee900a6ab02a2f7d470208c558b28fa317a5e..bc64f4894b4611f344dcad5226947aa52f733f0a 100644 (file)
@@ -383,15 +383,15 @@ static int gb_svc_version_request(struct gb_operation *op)
                return -ENOTSUPP;
        }
 
-       connection->module_major = request->major;
-       connection->module_minor = request->minor;
+       svc->protocol_major = request->major;
+       svc->protocol_minor = request->minor;
 
        if (!gb_operation_response_alloc(op, sizeof(*response), GFP_KERNEL))
                return -ENOMEM;
 
        response = op->response->payload;
-       response->major = connection->module_major;
-       response->minor = connection->module_minor;
+       response->major = svc->protocol_major;
+       response->minor = svc->protocol_minor;
 
        return 0;
 }
index 8567615068a7faa7bb3a70209587fc5072b2d6a2..4abc5efad807d69587d9f4968047b344f4c0729e 100644 (file)
@@ -27,6 +27,9 @@ struct gb_svc {
 
        u16 endo_id;
        u8 ap_intf_id;
+
+       u8 protocol_major;
+       u8 protocol_minor;
 };
 #define to_gb_svc(d) container_of(d, struct gb_svc, d)