From ee8f81b0961fa240ddf4d7740ac501606e4ed230 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Thu, 19 Mar 2015 16:46:18 +0100 Subject: [PATCH] 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: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/operation.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index 83359dde1a8f..c85fd401546c 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -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; -- 2.39.5