diff options
Diffstat (limited to 'drivers/uwb/rsv.c')
-rw-r--r-- | drivers/uwb/rsv.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/uwb/rsv.c b/drivers/uwb/rsv.c index ce0094657d3d..3d76efe26acc 100644 --- a/drivers/uwb/rsv.c +++ b/drivers/uwb/rsv.c | |||
@@ -659,6 +659,25 @@ static void uwb_rsv_timer(unsigned long arg) | |||
659 | uwb_rsv_sched_update(rsv->rc); | 659 | uwb_rsv_sched_update(rsv->rc); |
660 | } | 660 | } |
661 | 661 | ||
662 | /** | ||
663 | * uwb_rsv_remove_all - remove all reservations | ||
664 | * @rc: the radio controller | ||
665 | * | ||
666 | * A DRP IE update is not done. | ||
667 | */ | ||
668 | void uwb_rsv_remove_all(struct uwb_rc *rc) | ||
669 | { | ||
670 | struct uwb_rsv *rsv, *t; | ||
671 | |||
672 | mutex_lock(&rc->rsvs_mutex); | ||
673 | list_for_each_entry_safe(rsv, t, &rc->reservations, rc_node) { | ||
674 | uwb_rsv_remove(rsv); | ||
675 | } | ||
676 | mutex_unlock(&rc->rsvs_mutex); | ||
677 | |||
678 | cancel_work_sync(&rc->rsv_update_work); | ||
679 | } | ||
680 | |||
662 | void uwb_rsv_init(struct uwb_rc *rc) | 681 | void uwb_rsv_init(struct uwb_rc *rc) |
663 | { | 682 | { |
664 | INIT_LIST_HEAD(&rc->reservations); | 683 | INIT_LIST_HEAD(&rc->reservations); |
@@ -682,14 +701,6 @@ int uwb_rsv_setup(struct uwb_rc *rc) | |||
682 | 701 | ||
683 | void uwb_rsv_cleanup(struct uwb_rc *rc) | 702 | void uwb_rsv_cleanup(struct uwb_rc *rc) |
684 | { | 703 | { |
685 | struct uwb_rsv *rsv, *t; | 704 | uwb_rsv_remove_all(rc); |
686 | |||
687 | mutex_lock(&rc->rsvs_mutex); | ||
688 | list_for_each_entry_safe(rsv, t, &rc->reservations, rc_node) { | ||
689 | uwb_rsv_remove(rsv); | ||
690 | } | ||
691 | mutex_unlock(&rc->rsvs_mutex); | ||
692 | |||
693 | cancel_work_sync(&rc->rsv_update_work); | ||
694 | destroy_workqueue(rc->rsv_workq); | 705 | destroy_workqueue(rc->rsv_workq); |
695 | } | 706 | } |