Skip to content

Commit 97989ad

Browse files
Robert P. J. Daymchehab
authored andcommitted
V4L/DVB (5847): Clean up schedule_timeout calls in cpia2 and ivtv code
Signed-off-by: Robert P. J. Day <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent f3a43d3 commit 97989ad

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

drivers/media/video/cpia2/cpia2_core.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -663,15 +663,13 @@ int cpia2_reset_camera(struct camera_data *cam)
663663
cpia2_send_command(cam, &cmd);
664664
}
665665

666-
current->state = TASK_INTERRUPTIBLE;
667-
schedule_timeout(100 * HZ / 1000); /* wait for 100 msecs */
666+
schedule_timeout_interruptible(msecs_to_jiffies(100));
668667

669668
if (cam->params.pnp_id.device_type == DEVICE_STV_672)
670669
retval = apply_vp_patch(cam);
671670

672671
/* wait for vp to go to sleep */
673-
current->state = TASK_INTERRUPTIBLE;
674-
schedule_timeout(100 * HZ / 1000); /* wait for 100 msecs */
672+
schedule_timeout_interruptible(msecs_to_jiffies(100));
675673

676674
/***
677675
* If this is a 676, apply VP5 fixes before we start streaming
@@ -720,8 +718,7 @@ int cpia2_reset_camera(struct camera_data *cam)
720718
set_default_user_mode(cam);
721719

722720
/* Give VP time to wake up */
723-
current->state = TASK_INTERRUPTIBLE;
724-
schedule_timeout(100 * HZ / 1000); /* wait for 100 msecs */
721+
schedule_timeout_interruptible(msecs_to_jiffies(100));
725722

726723
set_all_properties(cam);
727724

drivers/media/video/ivtv/ivtv-gpio.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ void ivtv_reset_ir_gpio(struct ivtv *itv)
115115
curout = (curout & ~0xF) | 1;
116116
write_reg(curout, IVTV_REG_GPIO_OUT);
117117
/* We could use something else for smaller time */
118-
current->state = TASK_INTERRUPTIBLE;
119-
schedule_timeout(1);
118+
schedule_timeout_interruptible(msecs_to_jiffies(1));
120119
curout |= 2;
121120
write_reg(curout, IVTV_REG_GPIO_OUT);
122121
curdir &= ~0x80;
@@ -138,13 +137,11 @@ int ivtv_reset_tuner_gpio(enum v4l2_tuner_type mode, void *priv, int ptr)
138137

139138
curout &= ~(1 << 12);
140139
write_reg(curout, IVTV_REG_GPIO_OUT);
141-
current->state = TASK_INTERRUPTIBLE;
142-
schedule_timeout(1);
140+
schedule_timeout_interruptible(msecs_to_jiffies(1));
143141

144142
curout |= (1 << 12);
145143
write_reg(curout, IVTV_REG_GPIO_OUT);
146-
current->state = TASK_INTERRUPTIBLE;
147-
schedule_timeout(1);
144+
schedule_timeout_interruptible(msecs_to_jiffies(1));
148145

149146
return 0;
150147
}

0 commit comments

Comments
 (0)