V4L/DVB (5846): Clean up setting state and scheduling timeouts
Replace assignments to "current->state" with the preferred calls to schedule_timeout_interruptible(). Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
bd58df6d52
commit
f3a43d3082
2 changed files with 4 additions and 8 deletions
|
@ -157,8 +157,7 @@ static int msp_read(struct i2c_client *client, int dev, int addr)
|
||||||
break;
|
break;
|
||||||
v4l_warn(client, "I/O error #%d (read 0x%02x/0x%02x)\n", err,
|
v4l_warn(client, "I/O error #%d (read 0x%02x/0x%02x)\n", err,
|
||||||
dev, addr);
|
dev, addr);
|
||||||
current->state = TASK_INTERRUPTIBLE;
|
schedule_timeout_interruptible(msecs_to_jiffies(10));
|
||||||
schedule_timeout(msecs_to_jiffies(10));
|
|
||||||
}
|
}
|
||||||
if (err == 3) {
|
if (err == 3) {
|
||||||
v4l_warn(client, "giving up, resetting chip. Sound will go off, sorry folks :-|\n");
|
v4l_warn(client, "giving up, resetting chip. Sound will go off, sorry folks :-|\n");
|
||||||
|
@ -197,8 +196,7 @@ static int msp_write(struct i2c_client *client, int dev, int addr, int val)
|
||||||
break;
|
break;
|
||||||
v4l_warn(client, "I/O error #%d (write 0x%02x/0x%02x)\n", err,
|
v4l_warn(client, "I/O error #%d (write 0x%02x/0x%02x)\n", err,
|
||||||
dev, addr);
|
dev, addr);
|
||||||
current->state = TASK_INTERRUPTIBLE;
|
schedule_timeout_interruptible(msecs_to_jiffies(10));
|
||||||
schedule_timeout(msecs_to_jiffies(10));
|
|
||||||
}
|
}
|
||||||
if (err == 3) {
|
if (err == 3) {
|
||||||
v4l_warn(client, "giving up, resetting chip. Sound will go off, sorry folks :-|\n");
|
v4l_warn(client, "giving up, resetting chip. Sound will go off, sorry folks :-|\n");
|
||||||
|
|
|
@ -2077,12 +2077,10 @@ static int vino_wait_for_frame(struct vino_channel_settings *vcs)
|
||||||
init_waitqueue_entry(&wait, current);
|
init_waitqueue_entry(&wait, current);
|
||||||
/* add ourselves into wait queue */
|
/* add ourselves into wait queue */
|
||||||
add_wait_queue(&vcs->fb_queue.frame_wait_queue, &wait);
|
add_wait_queue(&vcs->fb_queue.frame_wait_queue, &wait);
|
||||||
/* and set current state */
|
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
|
||||||
|
|
||||||
/* to ensure that schedule_timeout will return immediately
|
/* to ensure that schedule_timeout will return immediately
|
||||||
* if VINO interrupt was triggred meanwhile */
|
* if VINO interrupt was triggered meanwhile */
|
||||||
schedule_timeout(HZ / 10);
|
schedule_timeout_interruptible(HZ / 10);
|
||||||
|
|
||||||
if (signal_pending(current))
|
if (signal_pending(current))
|
||||||
err = -EINTR;
|
err = -EINTR;
|
||||||
|
|
Loading…
Add table
Reference in a new issue