Commit 75b93b59 authored by Szymon Janc's avatar Szymon Janc Committed by Johan Hedberg

Bluetooth: Make l2cap_clear_timer return if timer was running or not

This is usefull when need to make action after timer was cleared
depending on if it was running or not.
Signed-off-by: default avatarSzymon Janc <szymon.janc@tieto.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 8b281b9c
...@@ -616,11 +616,16 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan, ...@@ -616,11 +616,16 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan,
schedule_delayed_work(work, timeout); schedule_delayed_work(work, timeout);
} }
static inline void l2cap_clear_timer(struct l2cap_chan *chan, static inline bool l2cap_clear_timer(struct l2cap_chan *chan,
struct delayed_work *work) struct delayed_work *work)
{ {
if (__cancel_delayed_work(work)) bool ret;
ret = __cancel_delayed_work(work);
if (ret)
l2cap_chan_put(chan); l2cap_chan_put(chan);
return ret;
} }
#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) #define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment