summaryrefslogtreecommitdiff
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2012-01-11 09:59:45 (GMT)
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-13 15:01:25 (GMT)
commit75b93b59ad625d734b1c7d7e05bf6b9898c8c28f (patch)
treefd57ebd9987b118fb53a16620add52ef7a544abf /include/net/bluetooth
parent8b281b9c7820b054d15cf471c418fd884cbbec78 (diff)
downloadlinux-fsl-qoriq-75b93b59ad625d734b1c7d7e05bf6b9898c8c28f.tar.xz
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: Szymon Janc <szymon.janc@tieto.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/l2cap.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 26486e1..238daf8 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -616,11 +616,16 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan,
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)
{
- if (__cancel_delayed_work(work))
+ bool ret;
+
+ ret = __cancel_delayed_work(work);
+ if (ret)
l2cap_chan_put(chan);
+
+ return ret;
}
#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))