greybus: connection: protocol can be NULL in gb_connection_exit()

gb_connection_exit() is getting called from gb_connection_destroy() now,
which will get called from failure path of gb_connection_create_range()
(in a later commit). And at that point connection->protocol will be
NULL.

Don't print an error message if this happens in gb_connection_exit().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
This commit is contained in:
Viresh Kumar 2015-08-31 17:21:15 +05:30 committed by Johan Hovold
parent 50bb9ccaa0
commit 6c0d57b4e6
1 changed files with 1 additions and 3 deletions

View File

@ -396,10 +396,8 @@ disconnect:
static void gb_connection_exit(struct gb_connection *connection) static void gb_connection_exit(struct gb_connection *connection)
{ {
if (!connection->protocol) { if (!connection->protocol)
dev_warn(&connection->dev, "exit without protocol.\n");
return; return;
}
spin_lock_irq(&connection->lock); spin_lock_irq(&connection->lock);
if (connection->state != GB_CONNECTION_STATE_ENABLED) { if (connection->state != GB_CONNECTION_STATE_ENABLED) {