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

Commit e313ac12 authored by Kees Cook's avatar Kees Cook Committed by David S. Miller
Browse files

mISDN: Convert timers to use timer_setup()



In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Geliang Tang <geliangtang@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Anton Vasilyev <vasilyev@ispras.ru>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d9935679
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -172,7 +172,6 @@ isac_fill_fifo(struct isac_hw *isac)
		pr_debug("%s: %s dbusytimer running\n", isac->name, __func__);
		del_timer(&isac->dch.timer);
	}
	init_timer(&isac->dch.timer);
	isac->dch.timer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ)/1000);
	add_timer(&isac->dch.timer);
	if (isac->dch.debug & DEBUG_HW_DFIFO) {
@@ -727,8 +726,9 @@ isac_release(struct isac_hw *isac)
}

static void
dbusy_timer_handler(struct isac_hw *isac)
dbusy_timer_handler(struct timer_list *t)
{
	struct isac_hw *isac = from_timer(isac, t, dch.timer);
	int rbch, star;
	u_long flags;

@@ -796,8 +796,7 @@ isac_init(struct isac_hw *isac)
	}
	isac->mon_tx = NULL;
	isac->mon_rx = NULL;
	setup_timer(&isac->dch.timer, (void *)dbusy_timer_handler,
		    (long)isac);
	timer_setup(&isac->dch.timer, dbusy_timer_handler, 0);
	isac->mocr = 0xaa;
	if (isac->type & IPAC_TYPE_ISACX) {
		/* Disable all IRQ */
+3 −4
Original line number Diff line number Diff line
@@ -311,7 +311,6 @@ W6692_fill_Dfifo(struct w6692_hw *card)
		pr_debug("%s: fill_Dfifo dbusytimer running\n", card->name);
		del_timer(&dch->timer);
	}
	init_timer(&dch->timer);
	dch->timer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ) / 1000);
	add_timer(&dch->timer);
	if (debug & DEBUG_HW_DFIFO) {
@@ -819,8 +818,9 @@ w6692_irq(int intno, void *dev_id)
}

static void
dbusy_timer_handler(struct dchannel *dch)
dbusy_timer_handler(struct timer_list *t)
{
	struct dchannel *dch = from_timer(dch, t, timer);
	struct w6692_hw	*card = dch->hw;
	int		rbch, star;
	u_long		flags;
@@ -852,8 +852,7 @@ static void initW6692(struct w6692_hw *card)
{
	u8	val;

	setup_timer(&card->dch.timer, (void *)dbusy_timer_handler,
		    (u_long)&card->dch);
	timer_setup(&card->dch.timer, dbusy_timer_handler, 0);
	w6692_mode(&card->bc[0], ISDN_P_NONE);
	w6692_mode(&card->bc[1], ISDN_P_NONE);
	WriteW6692(card, W_D_CTL, 0x00);
+1 −1
Original line number Diff line number Diff line
@@ -259,7 +259,7 @@ extern u8 *dsp_dtmf_goertzel_decode(struct dsp *dsp, u8 *data, int len,

extern int dsp_tone(struct dsp *dsp, int tone);
extern void dsp_tone_copy(struct dsp *dsp, u8 *data, int len);
extern void dsp_tone_timeout(void *arg);
extern void dsp_tone_timeout(struct timer_list *t);

extern void dsp_bf_encrypt(struct dsp *dsp, u8 *data, int len);
extern void dsp_bf_decrypt(struct dsp *dsp, u8 *data, int len);
+2 −4
Original line number Diff line number Diff line
@@ -1092,7 +1092,7 @@ dspcreate(struct channel_req *crq)
	ndsp->pcm_bank_tx = -1;
	ndsp->hfc_conf = -1; /* current conference number */
	/* set tone timer */
	setup_timer(&ndsp->tone.tl, (void *)dsp_tone_timeout, (long)ndsp);
	timer_setup(&ndsp->tone.tl, dsp_tone_timeout, 0);

	if (dtmfthreshold < 20 || dtmfthreshold > 500)
		dtmfthreshold = 200;
@@ -1202,9 +1202,7 @@ static int __init dsp_init(void)
	}

	/* set sample timer */
	dsp_spl_tl.function = (void *)dsp_cmx_send;
	dsp_spl_tl.data = 0;
	init_timer(&dsp_spl_tl);
	timer_setup(&dsp_spl_tl, (void *)dsp_cmx_send, 0);
	dsp_spl_tl.expires = jiffies + dsp_tics;
	dsp_spl_jiffies = dsp_spl_tl.expires;
	add_timer(&dsp_spl_tl);
+2 −4
Original line number Diff line number Diff line
@@ -457,9 +457,9 @@ dsp_tone_hw_message(struct dsp *dsp, u8 *sample, int len)
 * timer expires *
 *****************/
void
dsp_tone_timeout(void *arg)
dsp_tone_timeout(struct timer_list *t)
{
	struct dsp *dsp = arg;
	struct dsp *dsp = from_timer(dsp, t, tone.tl);
	struct dsp_tone *tone = &dsp->tone;
	struct pattern *pat = (struct pattern *)tone->pattern;
	int index = tone->index;
@@ -478,7 +478,6 @@ dsp_tone_timeout(void *arg)
	else
		dsp_tone_hw_message(dsp, pat->data[index], *(pat->siz[index]));
	/* set timer */
	init_timer(&tone->tl);
	tone->tl.expires = jiffies + (pat->seq[index] * HZ) / 8000;
	add_timer(&tone->tl);
}
@@ -541,7 +540,6 @@ dsp_tone(struct dsp *dsp, int tone)
		/* set timer */
		if (timer_pending(&tonet->tl))
			del_timer(&tonet->tl);
		init_timer(&tonet->tl);
		tonet->tl.expires = jiffies + (pat->seq[0] * HZ) / 8000;
		add_timer(&tonet->tl);
	} else {
Loading