diff options
author | Geliang Tang <geliangtang@gmail.com> | 2017-03-23 21:15:57 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-24 12:33:42 -0700 |
commit | aff55a3638a2d13de5cf0b0c45993378282cbe91 (patch) | |
tree | f410bca6f54d51817634f5a8fa92304ac69a1b4e /drivers/isdn/hardware | |
parent | 9096643856919eba4ea7dd462e3528bc6d230f4f (diff) | |
download | linux-aff55a3638a2d13de5cf0b0c45993378282cbe91.tar.bz2 |
isdn: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/hardware')
-rw-r--r-- | drivers/isdn/hardware/eicon/divasi.c | 5 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/hfcmulti.c | 10 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/hfcpci.c | 9 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/mISDNipac.c | 5 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/mISDNisar.c | 10 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/w6692.c | 5 |
6 files changed, 17 insertions, 27 deletions
diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c index cb88090f9cea..c61049585cbd 100644 --- a/drivers/isdn/hardware/eicon/divasi.c +++ b/drivers/isdn/hardware/eicon/divasi.c @@ -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); diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index 480c2d7794eb..961c07ee47b7 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c @@ -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; diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index ff48da61c94c..5dc246d71c16 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c @@ -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; diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c index 77dec28ba874..6742b0dc0821 100644 --- a/drivers/isdn/hardware/mISDN/mISDNipac.c +++ b/drivers/isdn/hardware/mISDN/mISDNipac.c @@ -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 */ diff --git a/drivers/isdn/hardware/mISDN/mISDNisar.c b/drivers/isdn/hardware/mISDN/mISDNisar.c index feafa91c2ed9..5b078591b6ee 100644 --- a/drivers/isdn/hardware/mISDN/mISDNisar.c +++ b/drivers/isdn/hardware/mISDN/mISDNisar.c @@ -1635,13 +1635,11 @@ init_isar(struct isar_hw *isar) } if (isar->version != 1) return -EINVAL; - isar->ch[0].ftimer.function = &ftimer_handler; - isar->ch[0].ftimer.data = (long)&isar->ch[0]; - init_timer(&isar->ch[0].ftimer); + setup_timer(&isar->ch[0].ftimer, &ftimer_handler, + (long)&isar->ch[0]); test_and_set_bit(FLG_INITIALIZED, &isar->ch[0].bch.Flags); - isar->ch[1].ftimer.function = &ftimer_handler; - isar->ch[1].ftimer.data = (long)&isar->ch[1]; - init_timer(&isar->ch[1].ftimer); + setup_timer(&isar->ch[1].ftimer, &ftimer_handler, + (long)&isar->ch[1]); test_and_set_bit(FLG_INITIALIZED, &isar->ch[1].bch.Flags); return 0; } diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c index 3b067ea656bd..3052c836b89f 100644 --- a/drivers/isdn/hardware/mISDN/w6692.c +++ b/drivers/isdn/hardware/mISDN/w6692.c @@ -852,9 +852,8 @@ static void initW6692(struct w6692_hw *card) { u8 val; - card->dch.timer.function = (void *)dbusy_timer_handler; - card->dch.timer.data = (u_long)&card->dch; - init_timer(&card->dch.timer); + setup_timer(&card->dch.timer, (void *)dbusy_timer_handler, + (u_long)&card->dch); w6692_mode(&card->bc[0], ISDN_P_NONE); w6692_mode(&card->bc[1], ISDN_P_NONE); WriteW6692(card, W_D_CTL, 0x00); |