diff --git a/drivers/staging/greybus/hd.c b/drivers/staging/greybus/hd.c index f64b592187c0..52388257d3d2 100644 --- a/drivers/staging/greybus/hd.c +++ b/drivers/staging/greybus/hd.c @@ -54,6 +54,14 @@ int gb_hd_cport_reserve(struct gb_host_device *hd, u16 cport_id) } EXPORT_SYMBOL_GPL(gb_hd_cport_reserve); +void gb_hd_cport_release_reserved(struct gb_host_device *hd, u16 cport_id) +{ + struct ida *id_map = &hd->cport_id_map; + + ida_simple_remove(id_map, cport_id); +} +EXPORT_SYMBOL_GPL(gb_hd_cport_release_reserved); + /* Locking: Caller guarantees serialisation */ int gb_hd_cport_allocate(struct gb_host_device *hd, int cport_id, unsigned long flags) diff --git a/drivers/staging/greybus/hd.h b/drivers/staging/greybus/hd.h index 8510816c1796..ad229622654e 100644 --- a/drivers/staging/greybus/hd.h +++ b/drivers/staging/greybus/hd.h @@ -61,6 +61,7 @@ struct gb_host_device { #define to_gb_host_device(d) container_of(d, struct gb_host_device, dev) int gb_hd_cport_reserve(struct gb_host_device *hd, u16 cport_id); +void gb_hd_cport_release_reserved(struct gb_host_device *hd, u16 cport_id); int gb_hd_cport_allocate(struct gb_host_device *hd, int cport_id, unsigned long flags); void gb_hd_cport_release(struct gb_host_device *hd, u16 cport_id);