From: Johan Hovold Date: Thu, 11 Feb 2016 12:52:48 +0000 (+0100) Subject: greybus: i2c: add bundle-device prefix to error messages X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~716 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6d6fb2549f23d5d7d3494574b49e35df8e737645;p=karo-tx-linux.git greybus: i2c: add bundle-device prefix to error messages Replace all pr_err with dev_err so we can tell what device (and driver) a message was for. Testing Done: Compiled Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/i2c.c b/drivers/staging/greybus/i2c.c index 5a5af36570c8..ec74e870d76e 100644 --- a/drivers/staging/greybus/i2c.c +++ b/drivers/staging/greybus/i2c.c @@ -52,6 +52,7 @@ static int gb_i2c_functionality_operation(struct gb_i2c_device *gb_i2c_dev) static int gb_i2c_timeout_operation(struct gb_i2c_device *gb_i2c_dev, u16 msec) { + struct device *dev = &gb_i2c_dev->connection->bundle->dev; struct gb_i2c_timeout_request request; int ret; @@ -59,7 +60,7 @@ static int gb_i2c_timeout_operation(struct gb_i2c_device *gb_i2c_dev, u16 msec) ret = gb_operation_sync(gb_i2c_dev->connection, GB_I2C_TYPE_TIMEOUT, &request, sizeof(request), NULL, 0); if (ret) - pr_err("timeout operation failed (%d)\n", ret); + dev_err(dev, "timeout operation failed (%d)\n", ret); else gb_i2c_dev->timeout_msec = msec; @@ -69,6 +70,7 @@ static int gb_i2c_timeout_operation(struct gb_i2c_device *gb_i2c_dev, u16 msec) static int gb_i2c_retries_operation(struct gb_i2c_device *gb_i2c_dev, u8 retries) { + struct device *dev = &gb_i2c_dev->connection->bundle->dev; struct gb_i2c_retries_request request; int ret; @@ -76,7 +78,7 @@ static int gb_i2c_retries_operation(struct gb_i2c_device *gb_i2c_dev, ret = gb_operation_sync(gb_i2c_dev->connection, GB_I2C_TYPE_RETRIES, &request, sizeof(request), NULL, 0); if (ret) - pr_err("retries operation failed (%d)\n", ret); + dev_err(dev, "retries operation failed (%d)\n", ret); else gb_i2c_dev->retries = retries; @@ -201,6 +203,7 @@ static int gb_i2c_transfer_operation(struct gb_i2c_device *gb_i2c_dev, struct i2c_msg *msgs, u32 msg_count) { struct gb_connection *connection = gb_i2c_dev->connection; + struct device *dev = &connection->bundle->dev; struct gb_operation *operation; int ret; @@ -216,7 +219,7 @@ static int gb_i2c_transfer_operation(struct gb_i2c_device *gb_i2c_dev, gb_i2c_decode_response(msgs, msg_count, response); ret = msg_count; } else if (!gb_i2c_expected_transfer_error(ret)) { - pr_err("transfer operation failed (%d)\n", ret); + dev_err(dev, "transfer operation failed (%d)\n", ret); } gb_operation_put(operation);