From 9942fc8b14f21525622b85031b19c7ab5b16b339 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Tue, 13 Oct 2015 19:10:28 +0200 Subject: [PATCH] greybus: protocol: make protocol-lookup error message more informative Make protocol lookup error more informative, by moving it to gb_connection_bind_protocol and using dev_err. Also make sure to use hex format for the protocol id as that is what is used everywhere else. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/connection.c | 7 ++++++- drivers/staging/greybus/protocol.c | 3 --- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index 1158674f2201..ca812f8a44f8 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -551,8 +551,13 @@ int gb_connection_bind_protocol(struct gb_connection *connection) protocol = gb_protocol_get(connection->protocol_id, connection->major, connection->minor); - if (!protocol) + if (!protocol) { + dev_warn(&connection->dev, + "protocol 0x%02hhx version %hhu.%hhu not found\n", + connection->protocol_id, + connection->major, connection->minor); return 0; + } connection->protocol = protocol; /* diff --git a/drivers/staging/greybus/protocol.c b/drivers/staging/greybus/protocol.c index 41190e8dfccb..889cff2a10c2 100644 --- a/drivers/staging/greybus/protocol.c +++ b/drivers/staging/greybus/protocol.c @@ -144,9 +144,6 @@ struct gb_protocol *gb_protocol_get(u8 id, u8 major, u8 minor) if (protocol) WARN_ON(protocol_count == U8_MAX); - else - pr_err("protocol id %hhu version %hhu.%hhu not found\n", - id, major, minor); return protocol; } -- 2.39.5