Commit bf814547 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

greybus: protocol: Remove unnecessary params of gb_protocol_get_version()

Some of the parameters are not really required, drop them.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent b9938c49
...@@ -387,12 +387,7 @@ int gb_connection_init(struct gb_connection *connection) ...@@ -387,12 +387,7 @@ int gb_connection_init(struct gb_connection *connection)
* this for SVC as that is initiated by the SVC. * this for SVC as that is initiated by the SVC.
*/ */
if (connection->hd_cport_id != GB_SVC_CPORT_ID) { if (connection->hd_cport_id != GB_SVC_CPORT_ID) {
struct gb_protocol_version_response response; ret = gb_protocol_get_version(connection, NULL, 0);
ret = gb_protocol_get_version(connection,
GB_REQUEST_TYPE_PROTOCOL_VERSION,
NULL, 0, &response,
connection->protocol->major);
if (ret) { if (ret) {
dev_err(&connection->dev, dev_err(&connection->dev,
"Failed to get version CPort-%d (%d)\n", "Failed to get version CPort-%d (%d)\n",
......
...@@ -163,30 +163,30 @@ struct gb_protocol *gb_protocol_get(u8 id, u8 major, u8 minor) ...@@ -163,30 +163,30 @@ struct gb_protocol *gb_protocol_get(u8 id, u8 major, u8 minor)
return protocol; return protocol;
} }
int gb_protocol_get_version(struct gb_connection *connection, int type, int gb_protocol_get_version(struct gb_connection *connection, void *request,
void *request, int request_size, int request_size)
struct gb_protocol_version_response *response,
__u8 major)
{ {
struct gb_protocol_version_response response;
int retval; int retval;
retval = gb_operation_sync(connection, type, request, request_size, retval = gb_operation_sync(connection, GB_REQUEST_TYPE_PROTOCOL_VERSION,
response, sizeof(*response)); request, request_size, &response,
sizeof(response));
if (retval) if (retval)
return retval; return retval;
if (response->major > major) { if (response.major > connection->protocol->major) {
dev_err(&connection->dev, dev_err(&connection->dev,
"unsupported major version (%hhu > %hhu)\n", "unsupported major version (%hhu > %hhu)\n",
response->major, major); response.major, connection->protocol->major);
return -ENOTSUPP; return -ENOTSUPP;
} }
connection->module_major = response->major; connection->module_major = response.major;
connection->module_minor = response->minor; connection->module_minor = response.minor;
dev_dbg(&connection->dev, "version_major = %u version_minor = %u\n", dev_dbg(&connection->dev, "version_major = %u version_minor = %u\n",
response->major, response->minor); response.major, response.minor);
return 0; return 0;
} }
......
...@@ -44,10 +44,8 @@ int gb_protocol_deregister(struct gb_protocol *protocol); ...@@ -44,10 +44,8 @@ int gb_protocol_deregister(struct gb_protocol *protocol);
__gb_protocol_register(protocol, THIS_MODULE) __gb_protocol_register(protocol, THIS_MODULE)
struct gb_protocol *gb_protocol_get(u8 id, u8 major, u8 minor); struct gb_protocol *gb_protocol_get(u8 id, u8 major, u8 minor);
int gb_protocol_get_version(struct gb_connection *connection, int type, int gb_protocol_get_version(struct gb_connection *connection, void *request,
void *request, int request_size, int request_size);
struct gb_protocol_version_response *response,
__u8 major);
void gb_protocol_put(struct gb_protocol *protocol); void gb_protocol_put(struct gb_protocol *protocol);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment