summaryrefslogtreecommitdiff
path: root/drivers/isdn/hisax
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2017-03-23 21:15:57 +0800
committerDavid S. Miller <davem@davemloft.net>2017-03-24 12:33:42 -0700
commitaff55a3638a2d13de5cf0b0c45993378282cbe91 (patch)
treef410bca6f54d51817634f5a8fa92304ac69a1b4e /drivers/isdn/hisax
parent9096643856919eba4ea7dd462e3528bc6d230f4f (diff)
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/hisax')
-rw-r--r--drivers/isdn/hisax/amd7930_fn.c4
-rw-r--r--drivers/isdn/hisax/arcofi.c4
-rw-r--r--drivers/isdn/hisax/diva.c5
-rw-r--r--drivers/isdn/hisax/elsa.c4
-rw-r--r--drivers/isdn/hisax/fsm.c4
-rw-r--r--drivers/isdn/hisax/hfc4s8s_l1.c5
-rw-r--r--drivers/isdn/hisax/hfc_2bds0.c4
-rw-r--r--drivers/isdn/hisax/hfc_pci.c8
-rw-r--r--drivers/isdn/hisax/hfc_sx.c8
-rw-r--r--drivers/isdn/hisax/hfc_usb.c8
-rw-r--r--drivers/isdn/hisax/hfcscard.c4
-rw-r--r--drivers/isdn/hisax/icc.c4
-rw-r--r--drivers/isdn/hisax/ipacx.c4
-rw-r--r--drivers/isdn/hisax/isac.c4
-rw-r--r--drivers/isdn/hisax/isar.c10
-rw-r--r--drivers/isdn/hisax/isdnl3.c4
-rw-r--r--drivers/isdn/hisax/teleint.c4
-rw-r--r--drivers/isdn/hisax/w6692.c5
18 files changed, 27 insertions, 66 deletions
diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c
index 36817e0a0b94..3a4c2f9e19e9 100644
--- a/drivers/isdn/hisax/amd7930_fn.c
+++ b/drivers/isdn/hisax/amd7930_fn.c
@@ -789,7 +789,5 @@ void Amd7930_init(struct IsdnCardState *cs)
void setup_Amd7930(struct IsdnCardState *cs)
{
INIT_WORK(&cs->tqueue, Amd7930_bh);
- cs->dbusytimer.function = (void *) dbusy_timer_handler;
- cs->dbusytimer.data = (long) cs;
- init_timer(&cs->dbusytimer);
+ setup_timer(&cs->dbusytimer, (void *)dbusy_timer_handler, (long)cs);
}
diff --git a/drivers/isdn/hisax/arcofi.c b/drivers/isdn/hisax/arcofi.c
index 29ec2dfbd155..9826bad49e2c 100644
--- a/drivers/isdn/hisax/arcofi.c
+++ b/drivers/isdn/hisax/arcofi.c
@@ -125,9 +125,7 @@ clear_arcofi(struct IsdnCardState *cs) {
void
init_arcofi(struct IsdnCardState *cs) {
- cs->dc.isac.arcofitimer.function = (void *) arcofi_timer;
- cs->dc.isac.arcofitimer.data = (long) cs;
- init_timer(&cs->dc.isac.arcofitimer);
+ setup_timer(&cs->dc.isac.arcofitimer, (void *)arcofi_timer, (long)cs);
init_waitqueue_head(&cs->dc.isac.arcofi_wait);
test_and_set_bit(HW_ARCOFI, &cs->HW_Flags);
}
diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
index 4fc90de68d18..079336e593f9 100644
--- a/drivers/isdn/hisax/diva.c
+++ b/drivers/isdn/hisax/diva.c
@@ -976,9 +976,8 @@ static int setup_diva_common(struct IsdnCardState *cs)
printk(KERN_INFO "Diva: IPACX Design Id: %x\n",
MemReadISAC_IPACX(cs, IPACX_ID) & 0x3F);
} else { /* DIVA 2.0 */
- cs->hw.diva.tl.function = (void *) diva_led_handler;
- cs->hw.diva.tl.data = (long) cs;
- init_timer(&cs->hw.diva.tl);
+ setup_timer(&cs->hw.diva.tl, (void *)diva_led_handler,
+ (long)cs);
cs->readisac = &ReadISAC;
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c
index d8ef64da26f1..03bc5d504e22 100644
--- a/drivers/isdn/hisax/elsa.c
+++ b/drivers/isdn/hisax/elsa.c
@@ -1147,9 +1147,7 @@ static int setup_elsa_common(struct IsdnCard *card)
init_arcofi(cs);
#endif
setup_isac(cs);
- cs->hw.elsa.tl.function = (void *) elsa_led_handler;
- cs->hw.elsa.tl.data = (long) cs;
- init_timer(&cs->hw.elsa.tl);
+ setup_timer(&cs->hw.elsa.tl, (void *)elsa_led_handler, (long)cs);
/* Teste Timer */
if (cs->hw.elsa.timer) {
byteout(cs->hw.elsa.trig, 0xff);
diff --git a/drivers/isdn/hisax/fsm.c b/drivers/isdn/hisax/fsm.c
index c7a94713e9ec..d63266fa8cbd 100644
--- a/drivers/isdn/hisax/fsm.c
+++ b/drivers/isdn/hisax/fsm.c
@@ -98,13 +98,11 @@ void
FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft)
{
ft->fi = fi;
- ft->tl.function = (void *) FsmExpireTimer;
- ft->tl.data = (long) ft;
#if FSM_TIMER_DEBUG
if (ft->fi->debug)
ft->fi->printdebug(ft->fi, "FsmInitTimer %lx", (long) ft);
#endif
- init_timer(&ft->tl);
+ setup_timer(&ft->tl, (void *)FsmExpireTimer, (long)ft);
}
void
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c
index e034ed847ff3..90f051ce0259 100644
--- a/drivers/isdn/hisax/hfc4s8s_l1.c
+++ b/drivers/isdn/hisax/hfc4s8s_l1.c
@@ -1396,9 +1396,8 @@ setup_instance(hfc4s8s_hw *hw)
l1p = hw->l1 + i;
spin_lock_init(&l1p->lock);
l1p->hw = hw;
- l1p->l1_timer.function = (void *) hfc_l1_timer;
- l1p->l1_timer.data = (long) (l1p);
- init_timer(&l1p->l1_timer);
+ setup_timer(&l1p->l1_timer, (void *)hfc_l1_timer,
+ (long)(l1p));
l1p->st_num = i;
skb_queue_head_init(&l1p->d_tx_queue);
l1p->d_if.ifc.priv = hw->l1 + i;
diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c
index a756e5cb6871..ad8597a1a07e 100644
--- a/drivers/isdn/hisax/hfc_2bds0.c
+++ b/drivers/isdn/hisax/hfc_2bds0.c
@@ -1073,8 +1073,6 @@ set_cs_func(struct IsdnCardState *cs)
cs->writeisacfifo = &dummyf;
cs->BC_Read_Reg = &ReadReg;
cs->BC_Write_Reg = &WriteReg;
- cs->dbusytimer.function = (void *) hfc_dbusy_timer;
- cs->dbusytimer.data = (long) cs;
- init_timer(&cs->dbusytimer);
+ setup_timer(&cs->dbusytimer, (void *)hfc_dbusy_timer, (long)cs);
INIT_WORK(&cs->tqueue, hfcd_bh);
}
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index 90449e1e91e5..f9ca35cc32b1 100644
--- a/drivers/isdn/hisax/hfc_pci.c
+++ b/drivers/isdn/hisax/hfc_pci.c
@@ -1582,9 +1582,7 @@ inithfcpci(struct IsdnCardState *cs)
cs->bcs[1].BC_SetStack = setstack_2b;
cs->bcs[0].BC_Close = close_hfcpci;
cs->bcs[1].BC_Close = close_hfcpci;
- cs->dbusytimer.function = (void *) hfcpci_dbusy_timer;
- cs->dbusytimer.data = (long) cs;
- init_timer(&cs->dbusytimer);
+ setup_timer(&cs->dbusytimer, (void *)hfcpci_dbusy_timer, (long)cs);
mode_hfcpci(cs->bcs, 0, 0);
mode_hfcpci(cs->bcs + 1, 0, 1);
}
@@ -1746,9 +1744,7 @@ setup_hfcpci(struct IsdnCard *card)
cs->BC_Write_Reg = NULL;
cs->irq_func = &hfcpci_interrupt;
cs->irq_flags |= IRQF_SHARED;
- cs->hw.hfcpci.timer.function = (void *) hfcpci_Timer;
- cs->hw.hfcpci.timer.data = (long) cs;
- init_timer(&cs->hw.hfcpci.timer);
+ setup_timer(&cs->hw.hfcpci.timer, (void *)hfcpci_Timer, (long)cs);
cs->cardmsg = &hfcpci_card_msg;
cs->auxcmd = &hfcpci_auxcmd;
diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c
index 13b2151c10f5..3aef8e1a90e4 100644
--- a/drivers/isdn/hisax/hfc_sx.c
+++ b/drivers/isdn/hisax/hfc_sx.c
@@ -1495,9 +1495,7 @@ int setup_hfcsx(struct IsdnCard *card)
} else
return (0); /* no valid card type */
- cs->dbusytimer.function = (void *) hfcsx_dbusy_timer;
- cs->dbusytimer.data = (long) cs;
- init_timer(&cs->dbusytimer);
+ setup_timer(&cs->dbusytimer, (void *)hfcsx_dbusy_timer, (long)cs);
INIT_WORK(&cs->tqueue, hfcsx_bh);
cs->readisac = NULL;
cs->writeisac = NULL;
@@ -1507,11 +1505,9 @@ int setup_hfcsx(struct IsdnCard *card)
cs->BC_Write_Reg = NULL;
cs->irq_func = &hfcsx_interrupt;
- cs->hw.hfcsx.timer.function = (void *) hfcsx_Timer;
- cs->hw.hfcsx.timer.data = (long) cs;
cs->hw.hfcsx.b_fifo_size = 0; /* fifo size still unknown */
cs->hw.hfcsx.cirm = ccd_sp_irqtab[cs->irq & 0xF]; /* RAM not evaluated */
- init_timer(&cs->hw.hfcsx.timer);
+ setup_timer(&cs->hw.hfcsx.timer, (void *)hfcsx_Timer, (long)cs);
reset_hfcsx(cs);
cs->cardmsg = &hfcsx_card_msg;
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index 678bd5224bc3..6dbd1f1da14f 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -1165,14 +1165,10 @@ hfc_usb_init(hfcusb_data *hfc)
hfc->old_led_state = 0;
/* init the t3 timer */
- init_timer(&hfc->t3_timer);
- hfc->t3_timer.data = (long) hfc;
- hfc->t3_timer.function = (void *) l1_timer_expire_t3;
+ setup_timer(&hfc->t3_timer, (void *)l1_timer_expire_t3, (long)hfc);
/* init the t4 timer */
- init_timer(&hfc->t4_timer);
- hfc->t4_timer.data = (long) hfc;
- hfc->t4_timer.function = (void *) l1_timer_expire_t4;
+ setup_timer(&hfc->t4_timer, (void *)l1_timer_expire_t4, (long)hfc);
/* init the background machinery for control requests */
hfc->ctrl_read.bRequestType = 0xc0;
diff --git a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c
index 394da646e97b..467287096918 100644
--- a/drivers/isdn/hisax/hfcscard.c
+++ b/drivers/isdn/hisax/hfcscard.c
@@ -253,9 +253,7 @@ int setup_hfcs(struct IsdnCard *card)
outb(0x57, cs->hw.hfcD.addr | 1);
}
set_cs_func(cs);
- cs->hw.hfcD.timer.function = (void *) hfcs_Timer;
- cs->hw.hfcD.timer.data = (long) cs;
- init_timer(&cs->hw.hfcD.timer);
+ setup_timer(&cs->hw.hfcD.timer, (void *)hfcs_Timer, (long)cs);
cs->cardmsg = &hfcs_card_msg;
cs->irq_func = &hfcs_interrupt;
return (1);
diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c
index 96d1df05044f..c7c3797a817e 100644
--- a/drivers/isdn/hisax/icc.c
+++ b/drivers/isdn/hisax/icc.c
@@ -676,7 +676,5 @@ clear_pending_icc_ints(struct IsdnCardState *cs)
void setup_icc(struct IsdnCardState *cs)
{
INIT_WORK(&cs->tqueue, icc_bh);
- cs->dbusytimer.function = (void *) dbusy_timer_handler;
- cs->dbusytimer.data = (long) cs;
- init_timer(&cs->dbusytimer);
+ setup_timer(&cs->dbusytimer, (void *)dbusy_timer_handler, (long)cs);
}
diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c
index 9cc26b40a437..43effe7082ed 100644
--- a/drivers/isdn/hisax/ipacx.c
+++ b/drivers/isdn/hisax/ipacx.c
@@ -424,9 +424,7 @@ dch_init(struct IsdnCardState *cs)
cs->setstack_d = dch_setstack;
- cs->dbusytimer.function = (void *) dbusy_timer_handler;
- cs->dbusytimer.data = (long) cs;
- init_timer(&cs->dbusytimer);
+ setup_timer(&cs->dbusytimer, (void *)dbusy_timer_handler, (long)cs);
cs->writeisac(cs, IPACX_TR_CONF0, 0x00); // clear LDD
cs->writeisac(cs, IPACX_TR_CONF2, 0x00); // enable transmitter
diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c
index df7e05ca8f9c..4273b4548825 100644
--- a/drivers/isdn/hisax/isac.c
+++ b/drivers/isdn/hisax/isac.c
@@ -677,7 +677,5 @@ void clear_pending_isac_ints(struct IsdnCardState *cs)
void setup_isac(struct IsdnCardState *cs)
{
INIT_WORK(&cs->tqueue, isac_bh);
- cs->dbusytimer.function = (void *) dbusy_timer_handler;
- cs->dbusytimer.data = (long) cs;
- init_timer(&cs->dbusytimer);
+ setup_timer(&cs->dbusytimer, (void *)dbusy_timer_handler, (long)cs);
}
diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c
index f4956c73aa11..0dc60b287c4b 100644
--- a/drivers/isdn/hisax/isar.c
+++ b/drivers/isdn/hisax/isar.c
@@ -1902,10 +1902,8 @@ void initisar(struct IsdnCardState *cs)
cs->bcs[1].BC_SetStack = setstack_isar;
cs->bcs[0].BC_Close = close_isarstate;
cs->bcs[1].BC_Close = close_isarstate;
- cs->bcs[0].hw.isar.ftimer.function = (void *) ftimer_handler;
- cs->bcs[0].hw.isar.ftimer.data = (long) &cs->bcs[0];
- init_timer(&cs->bcs[0].hw.isar.ftimer);
- cs->bcs[1].hw.isar.ftimer.function = (void *) ftimer_handler;
- cs->bcs[1].hw.isar.ftimer.data = (long) &cs->bcs[1];
- init_timer(&cs->bcs[1].hw.isar.ftimer);
+ setup_timer(&cs->bcs[0].hw.isar.ftimer, (void *)ftimer_handler,
+ (long)&cs->bcs[0]);
+ setup_timer(&cs->bcs[1].hw.isar.ftimer, (void *)ftimer_handler,
+ (long)&cs->bcs[1]);
}
diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c
index c754706f83cd..569ce52c567b 100644
--- a/drivers/isdn/hisax/isdnl3.c
+++ b/drivers/isdn/hisax/isdnl3.c
@@ -169,9 +169,7 @@ void
L3InitTimer(struct l3_process *pc, struct L3Timer *t)
{
t->pc = pc;
- t->tl.function = (void *) L3ExpireTimer;
- t->tl.data = (long) t;
- init_timer(&t->tl);
+ setup_timer(&t->tl, (void *)L3ExpireTimer, (long)t);
}
void
diff --git a/drivers/isdn/hisax/teleint.c b/drivers/isdn/hisax/teleint.c
index bf647545c70c..950399f066ef 100644
--- a/drivers/isdn/hisax/teleint.c
+++ b/drivers/isdn/hisax/teleint.c
@@ -278,9 +278,7 @@ int setup_TeleInt(struct IsdnCard *card)
cs->bcs[0].hw.hfc.send = NULL;
cs->bcs[1].hw.hfc.send = NULL;
cs->hw.hfc.fifosize = 7 * 1024 + 512;
- cs->hw.hfc.timer.function = (void *) TeleInt_Timer;
- cs->hw.hfc.timer.data = (long) cs;
- init_timer(&cs->hw.hfc.timer);
+ setup_timer(&cs->hw.hfc.timer, (void *)TeleInt_Timer, (long)cs);
if (!request_region(cs->hw.hfc.addr, 2, "TeleInt isdn")) {
printk(KERN_WARNING
"HiSax: TeleInt config port %x-%x already in use\n",
diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c
index a85895585d90..c99f0ec58a01 100644
--- a/drivers/isdn/hisax/w6692.c
+++ b/drivers/isdn/hisax/w6692.c
@@ -901,9 +901,8 @@ static void initW6692(struct IsdnCardState *cs, int part)
if (part & 1) {
cs->setstack_d = setstack_W6692;
cs->DC_Close = DC_Close_W6692;
- cs->dbusytimer.function = (void *) dbusy_timer_handler;
- cs->dbusytimer.data = (long) cs;
- init_timer(&cs->dbusytimer);
+ setup_timer(&cs->dbusytimer, (void *)dbusy_timer_handler,
+ (long)cs);
resetW6692(cs);
ph_command(cs, W_L1CMD_RST);
cs->dc.w6692.ph_state = W_L1CMD_RST;