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;