Commit ee8f81b0 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: operation: use dev_err in gb_operation_sync

Use the more informative dev_err in gb_operation_sync, which includes
the connection device name in the error message (which in turn encodes
the module, interface, bundle and cport ids).

Add missing braces to conditional-construct branches while at it.
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 25eb7329
......@@ -945,12 +945,15 @@ int gb_operation_sync(struct gb_connection *connection, int type,
memcpy(operation->request->payload, request, request_size);
ret = gb_operation_request_send_sync(operation);
if (ret)
pr_err("synchronous operation failed (%d)\n", ret);
else
if (response_size)
if (ret) {
dev_err(&connection->dev, "synchronous operation failed: %d\n",
ret);
} else {
if (response_size) {
memcpy(response, operation->response->payload,
response_size);
}
}
gb_operation_destroy(operation);
return ret;
......
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