diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index 466ea36da0aa..c25e5705f865 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -262,6 +262,8 @@ gb_connection_create_range(struct greybus_host_device *hd, gb_svc_connection_create(hd->svc, hd->endo->ap_intf_id, hd_cport_id, bundle->intf->interface_id, cport_id); + if (hd->driver->connection_create) + hd->driver->connection_create(connection); } gb_connection_bind_protocol(connection); @@ -430,6 +432,9 @@ 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; diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 8e215f870c1d..9f2eb1f2e8a9 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -75,6 +75,8 @@ struct greybus_host_device; struct greybus_host_driver { size_t hd_priv_size; + void (*connection_create)(struct gb_connection *connection); + void (*connection_destroy)(struct gb_connection *connection); int (*message_send)(struct greybus_host_device *hd, u16 dest_cport_id, struct gb_message *message, gfp_t gfp_mask); void (*message_cancel)(struct gb_message *message);