spin_unlock_irq(&connection->lock);
}
+static void
+gb_connection_svc_connection_destroy(struct gb_connection *connection)
+{
+ if (connection->hd_cport_id == GB_SVC_CPORT_ID)
+ return;
+
+ gb_svc_connection_destroy(connection->hd->svc,
+ connection->hd->endo->ap_intf_id,
+ connection->hd_cport_id,
+ connection->bundle->intf->interface_id,
+ connection->intf_cport_id);
+}
+
static void gb_connection_disconnected(struct gb_connection *connection)
{
struct gb_control *control;
dev_err(&connection->dev,
"Failed to connect CPort-%d (%d)\n",
cport_id, ret);
- return ret;
+ goto svc_destroy;
}
}
spin_unlock_irq(&connection->lock);
gb_connection_disconnected(connection);
+svc_destroy:
+ gb_connection_svc_connection_destroy(connection);
+
return ret;
}
connection->protocol->connection_exit(connection);
gb_connection_disconnected(connection);
+ gb_connection_svc_connection_destroy(connection);
}
/*