greybus: operation: replace pr_err with dev_err

Use dev_err whenever we have a connection for more informative error
messages.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
Johan Hovold 2015-03-27 12:41:19 +01:00 committed by Greg Kroah-Hartman
parent cfa79699cd
commit e1baa3f0a9

View File

@ -730,17 +730,19 @@ EXPORT_SYMBOL_GPL(gb_operation_request_send_sync);
*/ */
int gb_operation_response_send(struct gb_operation *operation, int errno) int gb_operation_response_send(struct gb_operation *operation, int errno)
{ {
struct gb_connection *connection = operation->connection;
int ret; int ret;
/* Record the result */ /* Record the result */
if (!gb_operation_result_set(operation, errno)) { if (!gb_operation_result_set(operation, errno)) {
pr_err("request result already set\n"); dev_err(&connection->dev, "request result already set\n");
return -EIO; /* Shouldn't happen */ return -EIO; /* Shouldn't happen */
} }
if (!operation->response) { if (!operation->response) {
if (!gb_operation_response_alloc(operation, 0)) { if (!gb_operation_response_alloc(operation, 0)) {
pr_err("error allocating response\n"); dev_err(&connection->dev,
"error allocating response\n");
/* XXX Respond with pre-allocated -ENOMEM? */ /* XXX Respond with pre-allocated -ENOMEM? */
return -ENOMEM; return -ENOMEM;
} }
@ -787,8 +789,10 @@ greybus_data_sent(struct greybus_host_device *hd, void *header, int status)
*/ */
operation = message->operation; operation = message->operation;
if (message == operation->response) { if (message == operation->response) {
if (status) if (status) {
pr_err("error %d sending response\n", status); dev_err(&operation->connection->dev,
"error sending response: %d\n", status);
}
gb_operation_put(operation); gb_operation_put(operation);
} else if (status) { } else if (status) {
if (gb_operation_result_set(operation, status)) if (gb_operation_result_set(operation, status))