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

Commit aff55a36 authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller
Browse files

isdn: use setup_timer



Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 90966438
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -157,10 +157,8 @@ int cf_command(int drvid, int mode,
	/* allocate mem for information struct */
	if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
		return (-ENOMEM); /* no memory */
	init_timer(&cs->timer);
	setup_timer(&cs->timer, deflect_timer_expire, (ulong)cs);
	cs->info[0] = '\0';
	cs->timer.function = deflect_timer_expire;
	cs->timer.data = (ulong) cs; /* pointer to own structure */
	cs->ics.driver = drvid;
	cs->ics.command = ISDN_CMD_PROT_IO; /* protocol specific io */
	cs->ics.arg = DSS1_CMD_INVOKE; /* invoke supplementary service */
@@ -452,10 +450,9 @@ static int isdn_divert_icall(isdn_ctrl *ic)
					return (0); /* no external deflection needed */
			if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
				return (0); /* no memory */
			init_timer(&cs->timer);
			setup_timer(&cs->timer, deflect_timer_expire,
				    (ulong)cs);
			cs->info[0] = '\0';
			cs->timer.function = deflect_timer_expire;
			cs->timer.data = (ulong) cs; /* pointer to own structure */

			cs->ics = *ic; /* copy incoming data */
			if (!cs->ics.parm.setup.phone[0]) strcpy(cs->ics.parm.setup.phone, "0");
+2 −3
Original line number Diff line number Diff line
@@ -300,9 +300,8 @@ static int um_idi_open_adapter(struct file *file, int adapter_nr)
	p_os = (diva_um_idi_os_context_t *) diva_um_id_get_os_context(e);
	init_waitqueue_head(&p_os->read_wait);
	init_waitqueue_head(&p_os->close_wait);
	init_timer(&p_os->diva_timer_id);
	p_os->diva_timer_id.function = (void *) diva_um_timer_function;
	p_os->diva_timer_id.data = (unsigned long) p_os;
	setup_timer(&p_os->diva_timer_id, (void *)diva_um_timer_function,
		    (unsigned long)p_os);
	p_os->aborted = 0;
	p_os->adapter_nr = adapter_nr;
	return (1);
+4 −6
Original line number Diff line number Diff line
@@ -3878,9 +3878,8 @@ hfcmulti_initmode(struct dchannel *dch)
		if (hc->dnum[pt]) {
			mode_hfcmulti(hc, dch->slot, dch->dev.D.protocol,
				      -1, 0, -1, 0);
			dch->timer.function = (void *) hfcmulti_dbusy_timer;
			dch->timer.data = (long) dch;
			init_timer(&dch->timer);
			setup_timer(&dch->timer, (void *)hfcmulti_dbusy_timer,
				    (long)dch);
		}
		for (i = 1; i <= 31; i++) {
			if (!((1 << i) & hc->bmask[pt])) /* skip unused chan */
@@ -3986,9 +3985,8 @@ hfcmulti_initmode(struct dchannel *dch)
		hc->chan[i].slot_rx = -1;
		hc->chan[i].conf = -1;
		mode_hfcmulti(hc, i, dch->dev.D.protocol, -1, 0, -1, 0);
		dch->timer.function = (void *) hfcmulti_dbusy_timer;
		dch->timer.data = (long) dch;
		init_timer(&dch->timer);
		setup_timer(&dch->timer, (void *)hfcmulti_dbusy_timer,
			    (long)dch);
		hc->chan[i - 2].slot_tx = -1;
		hc->chan[i - 2].slot_rx = -1;
		hc->chan[i - 2].conf = -1;
+3 −6
Original line number Diff line number Diff line
@@ -1717,9 +1717,8 @@ static void
inithfcpci(struct hfc_pci *hc)
{
	printk(KERN_DEBUG "inithfcpci: entered\n");
	hc->dch.timer.function = (void *) hfcpci_dbusy_timer;
	hc->dch.timer.data = (long) &hc->dch;
	init_timer(&hc->dch.timer);
	setup_timer(&hc->dch.timer, (void *)hfcpci_dbusy_timer,
		    (long)&hc->dch);
	hc->chanlimit = 2;
	mode_hfcpci(&hc->bch[0], 1, -1);
	mode_hfcpci(&hc->bch[1], 2, -1);
@@ -2044,9 +2043,7 @@ setup_hw(struct hfc_pci *hc)
	Write_hfc(hc, HFCPCI_INT_M1, hc->hw.int_m1);
	/* At this point the needed PCI config is done */
	/* fifos are still not enabled */
	hc->hw.timer.function = (void *) hfcpci_Timer;
	hc->hw.timer.data = (long) hc;
	init_timer(&hc->hw.timer);
	setup_timer(&hc->hw.timer, (void *)hfcpci_Timer, (long)hc);
	/* default PCM master */
	test_and_set_bit(HFC_CFG_MASTER, &hc->cfg);
	return 0;
+2 −3
Original line number Diff line number Diff line
@@ -796,9 +796,8 @@ isac_init(struct isac_hw *isac)
	}
	isac->mon_tx = NULL;
	isac->mon_rx = NULL;
	isac->dch.timer.function = (void *) dbusy_timer_handler;
	isac->dch.timer.data = (long)isac;
	init_timer(&isac->dch.timer);
	setup_timer(&isac->dch.timer, (void *)dbusy_timer_handler,
		    (long)isac);
	isac->mocr = 0xaa;
	if (isac->type & IPAC_TYPE_ISACX) {
		/* Disable all IRQ */
Loading