Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2ec9c1b authored by Gustavo Padovan's avatar Gustavo Padovan
Browse files

Bluetooth: Move l2cap_{set,clear}_timer to l2cap.h



It is the only place where it is used.

Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent 613a1c0c
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -595,6 +595,21 @@ enum {
	FLAG_EFS_ENABLE,
};

static inline void l2cap_set_timer(struct l2cap_chan *chan,
					struct delayed_work *work, long timeout)
{
	BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);

	cancel_delayed_work_sync(work);

	schedule_delayed_work(work, timeout);
}

static inline void l2cap_clear_timer(struct delayed_work *work)
{
	cancel_delayed_work_sync(work);
}

#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
#define __clear_chan_timer(c) l2cap_clear_timer(&c->chan_timer)
#define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \
+0 −14
Original line number Diff line number Diff line
@@ -228,20 +228,6 @@ static u16 l2cap_alloc_cid(struct l2cap_conn *conn)
	return 0;
}

static void l2cap_set_timer(struct l2cap_chan *chan, struct delayed_work *work, long timeout)
{
	BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);

	cancel_delayed_work_sync(work);

	schedule_delayed_work(work, timeout);
}

static void l2cap_clear_timer(struct delayed_work *work)
{
	cancel_delayed_work_sync(work);
}

static char *state_to_string(int state)
{
	switch(state) {