From 74c831653309872b4a514cb27f456f20a7914173 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Mon, 7 Dec 2015 15:05:31 +0100 Subject: [PATCH] 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: Johan Hovold Reviewed-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/connection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index bf28dad230b7..ae8cb6603a5e 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -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; -- 2.20.1