From: Johan Hovold Date: Mon, 7 Dec 2015 14:05:31 +0000 (+0100) Subject: greybus: connection: fail on missing protocol X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=74c831653309872b4a514cb27f456f20a7914173;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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;