Commit 74c83165 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: connection: fail on missing protocol

Make sure to fail properly when a protocol is missing.

This prevents the connection from being created, which is fine as we
currently never bind protocols post creation.

This is an intermediate step in moving protocol binding to
connection_init.
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 2d54e4db
......@@ -537,11 +537,11 @@ static int gb_connection_bind_protocol(struct gb_connection *connection)
connection->major,
connection->minor);
if (!protocol) {
dev_warn(&connection->hd->dev,
dev_err(&connection->hd->dev,
"protocol 0x%02x version %u.%u not found\n",
connection->protocol_id,
connection->major, connection->minor);
return 0;
return -EPROTONOSUPPORT;
}
connection->protocol = 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