diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2015-09-07 16:01:23 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-09-14 21:19:46 -0700 |
commit | fb198317fd89ec02582ffd4ca318ec088d06c74e (patch) | |
tree | ae11b337e8aaf8c4a56613b4f3cf5e1f99e2456e /drivers/staging/greybus | |
parent | 1b7a9cd5a54536af5a97738097780369779c62d9 (diff) | |
download | linux-stable-fb198317fd89ec02582ffd4ca318ec088d06c74e.tar.gz linux-stable-fb198317fd89ec02582ffd4ca318ec088d06c74e.tar.bz2 linux-stable-fb198317fd89ec02582ffd4ca318ec088d06c74e.zip |
greybus: connection: Call connection_destroy() from gb_connection_svc_connection_destroy()
connection_create() is called right after svc is requested to create the
connection and so connection_destroy() must be called just before we
request the SVC to destroy the connection.
Over that, this fixes the inconsistency where connection_create() is
called for all connections except SVC connection, but
connection_destroy() is called always.
Acked-by: Alexandre Bailon <abailon@baylibre.com>
Fixes: 5313ca607afb ("Greybus driver: add a new callbacks to driver")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r-- | drivers/staging/greybus/connection.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index de3962ab07bc..e1a7705fd227 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -318,6 +318,9 @@ gb_connection_svc_connection_destroy(struct gb_connection *connection) if (connection->hd_cport_id == GB_SVC_CPORT_ID) return; + if (connection->hd->driver->connection_destroy) + connection->hd->driver->connection_destroy(connection); + gb_svc_connection_destroy(connection->hd->svc, connection->hd->endo->ap_intf_id, connection->hd_cport_id, @@ -462,9 +465,6 @@ void gb_connection_destroy(struct gb_connection *connection) list_del(&connection->hd_links); spin_unlock_irq(&gb_connections_lock); - if (connection->hd->driver->connection_destroy) - connection->hd->driver->connection_destroy(connection); - if (connection->protocol) gb_protocol_put(connection->protocol); connection->protocol = NULL; |