diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2014-12-26 09:35:50 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-01-27 07:08:22 -0500 |
commit | 03f23fc51dc943fbda437abf04df5d6a8498addc (patch) | |
tree | 02c8557b169ce26ddc57588e78bde68367ec8e8c /drivers/media/usb | |
parent | f57cffb93457e968edac3afcae26f5c7670ed985 (diff) |
[media] pvrusb2: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.
A simplified version of the semantic match that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression t,f,d;
@@
-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index 2fd9b5e0e2a9..08f2f5aced9f 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, | |||
2425 | } | 2425 | } |
2426 | if (!hdw) goto fail; | 2426 | if (!hdw) goto fail; |
2427 | 2427 | ||
2428 | init_timer(&hdw->quiescent_timer); | 2428 | setup_timer(&hdw->quiescent_timer, pvr2_hdw_quiescent_timeout, |
2429 | hdw->quiescent_timer.data = (unsigned long)hdw; | 2429 | (unsigned long)hdw); |
2430 | hdw->quiescent_timer.function = pvr2_hdw_quiescent_timeout; | ||
2431 | 2430 | ||
2432 | init_timer(&hdw->decoder_stabilization_timer); | 2431 | setup_timer(&hdw->decoder_stabilization_timer, |
2433 | hdw->decoder_stabilization_timer.data = (unsigned long)hdw; | 2432 | pvr2_hdw_decoder_stabilization_timeout, |
2434 | hdw->decoder_stabilization_timer.function = | 2433 | (unsigned long)hdw); |
2435 | pvr2_hdw_decoder_stabilization_timeout; | ||
2436 | 2434 | ||
2437 | init_timer(&hdw->encoder_wait_timer); | 2435 | setup_timer(&hdw->encoder_wait_timer, pvr2_hdw_encoder_wait_timeout, |
2438 | hdw->encoder_wait_timer.data = (unsigned long)hdw; | 2436 | (unsigned long)hdw); |
2439 | hdw->encoder_wait_timer.function = pvr2_hdw_encoder_wait_timeout; | ||
2440 | 2437 | ||
2441 | init_timer(&hdw->encoder_run_timer); | 2438 | setup_timer(&hdw->encoder_run_timer, pvr2_hdw_encoder_run_timeout, |
2442 | hdw->encoder_run_timer.data = (unsigned long)hdw; | 2439 | (unsigned long)hdw); |
2443 | hdw->encoder_run_timer.function = pvr2_hdw_encoder_run_timeout; | ||
2444 | 2440 | ||
2445 | hdw->master_state = PVR2_STATE_DEAD; | 2441 | hdw->master_state = PVR2_STATE_DEAD; |
2446 | 2442 | ||
@@ -3680,10 +3676,8 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw, | |||
3680 | hdw->ctl_timeout_flag = 0; | 3676 | hdw->ctl_timeout_flag = 0; |
3681 | hdw->ctl_write_pend_flag = 0; | 3677 | hdw->ctl_write_pend_flag = 0; |
3682 | hdw->ctl_read_pend_flag = 0; | 3678 | hdw->ctl_read_pend_flag = 0; |
3683 | init_timer(&timer); | 3679 | setup_timer(&timer, pvr2_ctl_timeout, (unsigned long)hdw); |
3684 | timer.expires = jiffies + timeout; | 3680 | timer.expires = jiffies + timeout; |
3685 | timer.data = (unsigned long)hdw; | ||
3686 | timer.function = pvr2_ctl_timeout; | ||
3687 | 3681 | ||
3688 | if (write_len) { | 3682 | if (write_len) { |
3689 | hdw->cmd_debug_state = 2; | 3683 | hdw->cmd_debug_state = 2; |