@@ -90,9 +90,9 @@ isdnloop_bchan_send(isdnloop_card *card, int ch)
90
90
* data = pointer to card struct, set by kernel timer.data
91
91
*/
92
92
static void
93
- isdnloop_pollbchan (unsigned long data )
93
+ isdnloop_pollbchan (struct timer_list * t )
94
94
{
95
- isdnloop_card * card = ( isdnloop_card * ) data ;
95
+ isdnloop_card * card = from_timer ( card , t , rb_timer ) ;
96
96
unsigned long flags ;
97
97
98
98
if (card -> flags & ISDNLOOP_FLAGS_B1ACTIVE )
@@ -305,9 +305,9 @@ isdnloop_putmsg(isdnloop_card *card, unsigned char c)
305
305
* data = pointer to card struct
306
306
*/
307
307
static void
308
- isdnloop_polldchan (unsigned long data )
308
+ isdnloop_polldchan (struct timer_list * t )
309
309
{
310
- isdnloop_card * card = ( isdnloop_card * ) data ;
310
+ isdnloop_card * card = from_timer ( card , t , st_timer ) ;
311
311
struct sk_buff * skb ;
312
312
int avail ;
313
313
int left ;
@@ -373,8 +373,6 @@ isdnloop_polldchan(unsigned long data)
373
373
card -> flags |= ISDNLOOP_FLAGS_RBTIMER ;
374
374
spin_lock_irqsave (& card -> isdnloop_lock , flags );
375
375
del_timer (& card -> rb_timer );
376
- card -> rb_timer .function = isdnloop_pollbchan ;
377
- card -> rb_timer .data = (unsigned long ) card ;
378
376
card -> rb_timer .expires = jiffies + ISDNLOOP_TIMER_BCREAD ;
379
377
add_timer (& card -> rb_timer );
380
378
spin_unlock_irqrestore (& card -> isdnloop_lock , flags );
@@ -588,19 +586,21 @@ isdnloop_atimeout(isdnloop_card *card, int ch)
588
586
* Wrapper for isdnloop_atimeout().
589
587
*/
590
588
static void
591
- isdnloop_atimeout0 (unsigned long data )
589
+ isdnloop_atimeout0 (struct timer_list * t )
592
590
{
593
- isdnloop_card * card = (isdnloop_card * ) data ;
591
+ isdnloop_card * card = from_timer (card , t , c_timer [0 ]);
592
+
594
593
isdnloop_atimeout (card , 0 );
595
594
}
596
595
597
596
/*
598
597
* Wrapper for isdnloop_atimeout().
599
598
*/
600
599
static void
601
- isdnloop_atimeout1 (unsigned long data )
600
+ isdnloop_atimeout1 (struct timer_list * t )
602
601
{
603
- isdnloop_card * card = (isdnloop_card * ) data ;
602
+ isdnloop_card * card = from_timer (card , t , c_timer [1 ]);
603
+
604
604
isdnloop_atimeout (card , 1 );
605
605
}
606
606
@@ -617,13 +617,9 @@ isdnloop_start_ctimer(isdnloop_card *card, int ch)
617
617
unsigned long flags ;
618
618
619
619
spin_lock_irqsave (& card -> isdnloop_lock , flags );
620
- init_timer (& card -> c_timer [ch ]);
620
+ timer_setup (& card -> c_timer [ch ], ch ? isdnloop_atimeout1
621
+ : isdnloop_atimeout0 , 0 );
621
622
card -> c_timer [ch ].expires = jiffies + ISDNLOOP_TIMER_ALERTWAIT ;
622
- if (ch )
623
- card -> c_timer [ch ].function = isdnloop_atimeout1 ;
624
- else
625
- card -> c_timer [ch ].function = isdnloop_atimeout0 ;
626
- card -> c_timer [ch ].data = (unsigned long ) card ;
627
623
add_timer (& card -> c_timer [ch ]);
628
624
spin_unlock_irqrestore (& card -> isdnloop_lock , flags );
629
625
}
@@ -1113,10 +1109,9 @@ isdnloop_start(isdnloop_card *card, isdnloop_sdef *sdefp)
1113
1109
sdef .ptype );
1114
1110
return - EINVAL ;
1115
1111
}
1116
- init_timer (& card -> st_timer );
1112
+ timer_setup (& card -> rb_timer , isdnloop_pollbchan , 0 );
1113
+ timer_setup (& card -> st_timer , isdnloop_polldchan , 0 );
1117
1114
card -> st_timer .expires = jiffies + ISDNLOOP_TIMER_DCREAD ;
1118
- card -> st_timer .function = isdnloop_polldchan ;
1119
- card -> st_timer .data = (unsigned long ) card ;
1120
1115
add_timer (& card -> st_timer );
1121
1116
card -> flags |= ISDNLOOP_FLAGS_RUNNING ;
1122
1117
spin_unlock_irqrestore (& card -> isdnloop_lock , flags );
0 commit comments