diff options
Diffstat (limited to 'drivers/media/usb/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index 2fd9b5e0e2a9..930593d7028d 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -2425,22 +2425,18 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, } if (!hdw) goto fail; - init_timer(&hdw->quiescent_timer); - hdw->quiescent_timer.data = (unsigned long)hdw; - hdw->quiescent_timer.function = pvr2_hdw_quiescent_timeout; + setup_timer(&hdw->quiescent_timer, pvr2_hdw_quiescent_timeout, + (unsigned long)hdw); - init_timer(&hdw->decoder_stabilization_timer); - hdw->decoder_stabilization_timer.data = (unsigned long)hdw; - hdw->decoder_stabilization_timer.function = - pvr2_hdw_decoder_stabilization_timeout; + setup_timer(&hdw->decoder_stabilization_timer, + pvr2_hdw_decoder_stabilization_timeout, + (unsigned long)hdw); - init_timer(&hdw->encoder_wait_timer); - hdw->encoder_wait_timer.data = (unsigned long)hdw; - hdw->encoder_wait_timer.function = pvr2_hdw_encoder_wait_timeout; + setup_timer(&hdw->encoder_wait_timer, pvr2_hdw_encoder_wait_timeout, + (unsigned long)hdw); - init_timer(&hdw->encoder_run_timer); - hdw->encoder_run_timer.data = (unsigned long)hdw; - hdw->encoder_run_timer.function = pvr2_hdw_encoder_run_timeout; + setup_timer(&hdw->encoder_run_timer, pvr2_hdw_encoder_run_timeout, + (unsigned long)hdw); hdw->master_state = PVR2_STATE_DEAD; @@ -3680,10 +3676,8 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw, hdw->ctl_timeout_flag = 0; hdw->ctl_write_pend_flag = 0; hdw->ctl_read_pend_flag = 0; - init_timer(&timer); + setup_timer(&timer, pvr2_ctl_timeout, (unsigned long)hdw); timer.expires = jiffies + timeout; - timer.data = (unsigned long)hdw; - timer.function = pvr2_ctl_timeout; if (write_len) { hdw->cmd_debug_state = 2; @@ -4035,11 +4029,6 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw) } -int pvr2_hdw_cmd_powerdown(struct pvr2_hdw *hdw) -{ - return pvr2_issue_simple_cmd(hdw,FX2CMD_POWER_OFF); -} - int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) { @@ -4301,9 +4290,8 @@ static int state_eval_encoder_config(struct pvr2_hdw *hdw) the encoder. */ if (!hdw->state_encoder_waitok) { hdw->encoder_wait_timer.expires = - jiffies + - (HZ * TIME_MSEC_ENCODER_WAIT - / 1000); + jiffies + msecs_to_jiffies( + TIME_MSEC_ENCODER_WAIT); add_timer(&hdw->encoder_wait_timer); } } @@ -4426,8 +4414,8 @@ static int state_eval_encoder_run(struct pvr2_hdw *hdw) if (pvr2_encoder_start(hdw) < 0) return !0; hdw->state_encoder_run = !0; if (!hdw->state_encoder_runok) { - hdw->encoder_run_timer.expires = - jiffies + (HZ * TIME_MSEC_ENCODER_OK / 1000); + hdw->encoder_run_timer.expires = jiffies + + msecs_to_jiffies(TIME_MSEC_ENCODER_OK); add_timer(&hdw->encoder_run_timer); } } @@ -4518,9 +4506,8 @@ static int state_eval_decoder_run(struct pvr2_hdw *hdw) but before we did the pending check. */ if (!hdw->state_decoder_quiescent) { hdw->quiescent_timer.expires = - jiffies + - (HZ * TIME_MSEC_DECODER_WAIT - / 1000); + jiffies + msecs_to_jiffies( + TIME_MSEC_DECODER_WAIT); add_timer(&hdw->quiescent_timer); } } @@ -4544,9 +4531,8 @@ static int state_eval_decoder_run(struct pvr2_hdw *hdw) hdw->state_decoder_run = !0; if (hdw->decoder_client_id == PVR2_CLIENT_ID_SAA7115) { hdw->decoder_stabilization_timer.expires = - jiffies + - (HZ * TIME_MSEC_DECODER_STABILIZATION_WAIT / - 1000); + jiffies + msecs_to_jiffies( + TIME_MSEC_DECODER_STABILIZATION_WAIT); add_timer(&hdw->decoder_stabilization_timer); } else { hdw->state_decoder_ready = !0; |