Commit 9942fc8b authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

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: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent d4efa688
......@@ -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;
/*
......
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment