Use setup_timer() instead of init_timer() to simplify the code.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
dd->rhdrhead_intr_off = 1ULL << 32;
/* setup the stats timer; the add_timer is done at end of init */
- init_timer(&dd->stats_timer);
- dd->stats_timer.function = qib_get_6120_faststats;
- dd->stats_timer.data = (unsigned long) dd;
+ setup_timer(&dd->stats_timer, qib_get_6120_faststats,
+ (unsigned long)dd);
- init_timer(&dd->cspec->pma_timer);
- dd->cspec->pma_timer.function = pma_6120_timer;
- dd->cspec->pma_timer.data = (unsigned long) ppd;
+ setup_timer(&dd->cspec->pma_timer, pma_6120_timer,
+ (unsigned long)ppd);
dd->ureg_align = qib_read_kreg32(dd, kr_palign);
if (!qib_mini_init)
qib_write_kreg(dd, kr_rcvbthqp, QIB_KD_QP);
- init_timer(&ppd->cpspec->chase_timer);
- ppd->cpspec->chase_timer.function = reenable_7220_chase;
- ppd->cpspec->chase_timer.data = (unsigned long)ppd;
+ setup_timer(&ppd->cpspec->chase_timer, reenable_7220_chase,
+ (unsigned long)ppd);
qib_num_cfg_vls = 1; /* if any 7220's, only one VL */
if (!qib_mini_init)
write_7322_init_portregs(ppd);
- init_timer(&cp->chase_timer);
- cp->chase_timer.function = reenable_chase;
- cp->chase_timer.data = (unsigned long)ppd;
+ setup_timer(&cp->chase_timer, reenable_chase,
+ (unsigned long)ppd);
ppd++;
}
(u64) rcv_int_count << IBA7322_HDRHEAD_PKTINT_SHIFT;
/* setup the stats timer; the add_timer is done at end of init */
- init_timer(&dd->stats_timer);
- dd->stats_timer.function = qib_get_7322_faststats;
- dd->stats_timer.data = (unsigned long) dd;
+ setup_timer(&dd->stats_timer, qib_get_7322_faststats,
+ (unsigned long)dd);
dd->ureg_align = 0x10000; /* 64KB alignment */
spin_lock_init(&ppd->cc_shadow_lock);
init_waitqueue_head(&ppd->state_wait);
- init_timer(&ppd->symerr_clear_timer);
- ppd->symerr_clear_timer.function = qib_clear_symerror_on_linkup;
- ppd->symerr_clear_timer.data = (unsigned long)ppd;
+ setup_timer(&ppd->symerr_clear_timer, qib_clear_symerror_on_linkup,
+ (unsigned long)ppd);
ppd->qib_wq = NULL;
ppd->ibport_data.pmastats =
qib_get_eeprom_info(dd);
/* setup time (don't start yet) to verify we got interrupt */
- init_timer(&dd->intrchk_timer);
- dd->intrchk_timer.function = verify_interrupt;
- dd->intrchk_timer.data = (unsigned long) dd;
+ setup_timer(&dd->intrchk_timer, verify_interrupt,
+ (unsigned long)dd);
done:
return ret;
}
continue;
if (dd->flags & QIB_HAS_SEND_DMA)
ret = qib_setup_sdma(ppd);
- init_timer(&ppd->hol_timer);
- ppd->hol_timer.function = qib_hol_event;
- ppd->hol_timer.data = (unsigned long)ppd;
+ setup_timer(&ppd->hol_timer, qib_hol_event,
+ (unsigned long)ppd);
ppd->hol_state = QIB_HOL_UP;
}