Skip to content

Commit

Permalink
net: nfc: hci: llc_shdlc: use setup_timer() helper.
Browse files Browse the repository at this point in the history
Use setup_timer function instead of initializing timer with the
   function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Allen Pais authored and David S. Miller committed Sep 25, 2017
1 parent b1e07c5 commit 22d387e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions net/nfc/hci/llc_shdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,17 +763,14 @@ static void *llc_shdlc_init(struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv,
mutex_init(&shdlc->state_mutex);
shdlc->state = SHDLC_DISCONNECTED;

init_timer(&shdlc->connect_timer);
shdlc->connect_timer.data = (unsigned long)shdlc;
shdlc->connect_timer.function = llc_shdlc_connect_timeout;
setup_timer(&shdlc->connect_timer, llc_shdlc_connect_timeout,
(unsigned long)shdlc);

init_timer(&shdlc->t1_timer);
shdlc->t1_timer.data = (unsigned long)shdlc;
shdlc->t1_timer.function = llc_shdlc_t1_timeout;
setup_timer(&shdlc->t1_timer, llc_shdlc_t1_timeout,
(unsigned long)shdlc);

init_timer(&shdlc->t2_timer);
shdlc->t2_timer.data = (unsigned long)shdlc;
shdlc->t2_timer.function = llc_shdlc_t2_timeout;
setup_timer(&shdlc->t2_timer, llc_shdlc_t2_timeout,
(unsigned long)shdlc);

shdlc->w = SHDLC_MAX_WINDOW;
shdlc->srej_support = SHDLC_SREJ_SUPPORT;
Expand Down

0 comments on commit 22d387e

Please sign in to comment.