greybus: connection: no need to verify connection->protocol
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 31 Aug 2015 11:51:11 +0000 (17:21 +0530)
committerJohan Hovold <johan@hovoldconsulting.com>
Thu, 3 Sep 2015 12:43:51 +0000 (14:43 +0200)
connection->protocol will always be valid in gb_connection_init() as it
is called only from a single routine, after initializing the 'protocol'
field.

No need to check it again.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
drivers/staging/greybus/connection.c

index f89b199..557fe6d 100644 (file)
@@ -371,11 +371,6 @@ static int gb_connection_init(struct gb_connection *connection)
        int cport_id = connection->intf_cport_id;
        int ret;
 
-       if (!connection->protocol) {
-               dev_warn(&connection->dev, "init without protocol.\n");
-               return 0;
-       }
-
        /*
         * Inform Interface about Active CPorts. We don't need to do this
         * operation for control cport.