]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: operation: use dev_err in gb_operation_sync
authorJohan Hovold <johan@hovoldconsulting.com>
Thu, 19 Mar 2015 15:46:18 +0000 (16:46 +0100)
committerGreg Kroah-Hartman <greg@kroah.com>
Thu, 19 Mar 2015 16:28:19 +0000 (17:28 +0100)
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 <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/operation.c

index 83359dde1a8f757380a8b04a3e107f7482232a92..c85fd401546cfe1caa91fb4df0065c90e1194589 100644 (file)
@@ -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;