greybus: protocol: Remove unnecessary params of gb_protocol_get_version()
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 11 Aug 2015 02:06:16 +0000 (07:36 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 12 Aug 2015 02:34:34 +0000 (19:34 -0700)
Some of the parameters are not really required, drop them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/connection.c
drivers/staging/greybus/protocol.c
drivers/staging/greybus/protocol.h

index b1f1df81be50512ebc7dea71530860c7c5ce32e6..88383b6e603f5183b3df680cffcb92134be80f56 100644 (file)
@@ -387,12 +387,7 @@ int gb_connection_init(struct gb_connection *connection)
         * this for SVC as that is initiated by the SVC.
         */
        if (connection->hd_cport_id != GB_SVC_CPORT_ID) {
-               struct gb_protocol_version_response response;
-
-               ret = gb_protocol_get_version(connection,
-                                             GB_REQUEST_TYPE_PROTOCOL_VERSION,
-                                             NULL, 0, &response,
-                                             connection->protocol->major);
+               ret = gb_protocol_get_version(connection, NULL, 0);
                if (ret) {
                        dev_err(&connection->dev,
                                "Failed to get version CPort-%d (%d)\n",
index ba80f552fa31a1be0bcb0d743a8a88ade0c46558..b63e28c1b950b7d16dfd791a3779b5f63b2fa3af 100644 (file)
@@ -163,30 +163,30 @@ struct gb_protocol *gb_protocol_get(u8 id, u8 major, u8 minor)
        return protocol;
 }
 
-int gb_protocol_get_version(struct gb_connection *connection, int type,
-                           void *request, int request_size,
-                           struct gb_protocol_version_response *response,
-                           __u8 major)
+int gb_protocol_get_version(struct gb_connection *connection, void *request,
+                           int request_size)
 {
+       struct gb_protocol_version_response response;
        int retval;
 
-       retval = gb_operation_sync(connection, type, request, request_size,
-                                  response, sizeof(*response));
+       retval = gb_operation_sync(connection, GB_REQUEST_TYPE_PROTOCOL_VERSION,
+                                  request, request_size, &response,
+                                  sizeof(response));
        if (retval)
                return retval;
 
-       if (response->major > major) {
+       if (response.major > connection->protocol->major) {
                dev_err(&connection->dev,
                        "unsupported major version (%hhu > %hhu)\n",
-                       response->major, major);
+                       response.major, connection->protocol->major);
                return -ENOTSUPP;
        }
 
-       connection->module_major = response->major;
-       connection->module_minor = response->minor;
+       connection->module_major = response.major;
+       connection->module_minor = response.minor;
 
        dev_dbg(&connection->dev, "version_major = %u version_minor = %u\n",
-               response->major, response->minor);
+               response.major, response.minor);
 
        return 0;
 }
index 45606adacf3593152a448b7beda5ac569288f7a3..34a7f185a6383f27035aff2b0f46d40b121f15fc 100644 (file)
@@ -44,10 +44,8 @@ int gb_protocol_deregister(struct gb_protocol *protocol);
        __gb_protocol_register(protocol, THIS_MODULE)
 
 struct gb_protocol *gb_protocol_get(u8 id, u8 major, u8 minor);
-int gb_protocol_get_version(struct gb_connection *connection, int type,
-                           void *request, int request_size,
-                           struct gb_protocol_version_response *response,
-                           __u8 major);
+int gb_protocol_get_version(struct gb_connection *connection, void *request,
+                           int request_size);
 
 void gb_protocol_put(struct gb_protocol *protocol);