@@ -523,10 +523,7 @@ static void resync_tnc(struct timer_list *t)
523
523
524
524
525
525
/* Start resync timer again -- the TNC might be still absent */
526
-
527
- del_timer (& sp -> resync_t );
528
- sp -> resync_t .expires = jiffies + SIXP_RESYNC_TIMEOUT ;
529
- add_timer (& sp -> resync_t );
526
+ mod_timer (& sp -> resync_t , jiffies + SIXP_RESYNC_TIMEOUT );
530
527
}
531
528
532
529
static inline int tnc_init (struct sixpack * sp )
@@ -537,9 +534,7 @@ static inline int tnc_init(struct sixpack *sp)
537
534
538
535
sp -> tty -> ops -> write (sp -> tty , & inbyte , 1 );
539
536
540
- del_timer (& sp -> resync_t );
541
- sp -> resync_t .expires = jiffies + SIXP_RESYNC_TIMEOUT ;
542
- add_timer (& sp -> resync_t );
537
+ mod_timer (& sp -> resync_t , jiffies + SIXP_RESYNC_TIMEOUT );
543
538
544
539
return 0 ;
545
540
}
@@ -897,11 +892,8 @@ static void decode_prio_command(struct sixpack *sp, unsigned char cmd)
897
892
/* if the state byte has been received, the TNC is present,
898
893
so the resync timer can be reset. */
899
894
900
- if (sp -> tnc_state == TNC_IN_SYNC ) {
901
- del_timer (& sp -> resync_t );
902
- sp -> resync_t .expires = jiffies + SIXP_INIT_RESYNC_TIMEOUT ;
903
- add_timer (& sp -> resync_t );
904
- }
895
+ if (sp -> tnc_state == TNC_IN_SYNC )
896
+ mod_timer (& sp -> resync_t , jiffies + SIXP_INIT_RESYNC_TIMEOUT );
905
897
906
898
sp -> status1 = cmd & SIXP_PRIO_DATA_MASK ;
907
899
}
0 commit comments