summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2015-10-13 19:10:28 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2015-10-14 12:08:50 -0700
commit9942fc8b14f21525622b85031b19c7ab5b16b339 (patch)
treeb36a1d358521a6635e70bdf2d685799d98e4cffe /drivers/staging/greybus/connection.c
parentd4efa68803667ab9d3ff6786462d2702b89e58de (diff)
downloadlinux-stable-9942fc8b14f21525622b85031b19c7ab5b16b339.tar.gz
linux-stable-9942fc8b14f21525622b85031b19c7ab5b16b339.tar.bz2
linux-stable-9942fc8b14f21525622b85031b19c7ab5b16b339.zip
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 <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.c')
-rw-r--r--drivers/staging/greybus/connection.c7
1 files changed, 6 insertions, 1 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;
/*