]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/hamradio/6pack.c
net/hamradio/6pack: use mod_timer() to rearm timers
[linux.git] / drivers / net / hamradio / 6pack.c
index 28c74998035946d42c5d3a9113df212be3316114..a19868cba48cb06388e9b56dd18800228ba07540 100644 (file)
@@ -523,10 +523,7 @@ static void resync_tnc(struct timer_list *t)
 
 
        /* Start resync timer again -- the TNC might be still absent */
-
-       del_timer(&sp->resync_t);
-       sp->resync_t.expires    = jiffies + SIXP_RESYNC_TIMEOUT;
-       add_timer(&sp->resync_t);
+       mod_timer(&sp->resync_t, jiffies + SIXP_RESYNC_TIMEOUT);
 }
 
 static inline int tnc_init(struct sixpack *sp)
@@ -537,9 +534,7 @@ static inline int tnc_init(struct sixpack *sp)
 
        sp->tty->ops->write(sp->tty, &inbyte, 1);
 
-       del_timer(&sp->resync_t);
-       sp->resync_t.expires = jiffies + SIXP_RESYNC_TIMEOUT;
-       add_timer(&sp->resync_t);
+       mod_timer(&sp->resync_t, jiffies + SIXP_RESYNC_TIMEOUT);
 
        return 0;
 }
@@ -897,11 +892,8 @@ static void decode_prio_command(struct sixpack *sp, unsigned char cmd)
         /* if the state byte has been received, the TNC is present,
            so the resync timer can be reset. */
 
-       if (sp->tnc_state == TNC_IN_SYNC) {
-               del_timer(&sp->resync_t);
-               sp->resync_t.expires    = jiffies + SIXP_INIT_RESYNC_TIMEOUT;
-               add_timer(&sp->resync_t);
-       }
+       if (sp->tnc_state == TNC_IN_SYNC)
+               mod_timer(&sp->resync_t, jiffies + SIXP_INIT_RESYNC_TIMEOUT);
 
        sp->status1 = cmd & SIXP_PRIO_DATA_MASK;
 }