Skip to content

Commit f3a43d3

Browse files
Robert P. J. Daymchehab
authored andcommitted
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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent bd58df6 commit f3a43d3

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

drivers/media/video/msp3400-driver.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ static int msp_read(struct i2c_client *client, int dev, int addr)
157157
break;
158158
v4l_warn(client, "I/O error #%d (read 0x%02x/0x%02x)\n", err,
159159
dev, addr);
160-
current->state = TASK_INTERRUPTIBLE;
161-
schedule_timeout(msecs_to_jiffies(10));
160+
schedule_timeout_interruptible(msecs_to_jiffies(10));
162161
}
163162
if (err == 3) {
164163
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)
197196
break;
198197
v4l_warn(client, "I/O error #%d (write 0x%02x/0x%02x)\n", err,
199198
dev, addr);
200-
current->state = TASK_INTERRUPTIBLE;
201-
schedule_timeout(msecs_to_jiffies(10));
199+
schedule_timeout_interruptible(msecs_to_jiffies(10));
202200
}
203201
if (err == 3) {
204202
v4l_warn(client, "giving up, resetting chip. Sound will go off, sorry folks :-|\n");

drivers/media/video/vino.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,12 +2077,10 @@ static int vino_wait_for_frame(struct vino_channel_settings *vcs)
20772077
init_waitqueue_entry(&wait, current);
20782078
/* add ourselves into wait queue */
20792079
add_wait_queue(&vcs->fb_queue.frame_wait_queue, &wait);
2080-
/* and set current state */
2081-
set_current_state(TASK_INTERRUPTIBLE);
20822080

20832081
/* to ensure that schedule_timeout will return immediately
2084-
* if VINO interrupt was triggred meanwhile */
2085-
schedule_timeout(HZ / 10);
2082+
* if VINO interrupt was triggered meanwhile */
2083+
schedule_timeout_interruptible(HZ / 10);
20862084

20872085
if (signal_pending(current))
20882086
err = -EINTR;

0 commit comments

Comments
 (0)