diff options
Diffstat (limited to 'drivers/media/pci/tw5864/tw5864-video.c')
-rw-r--r-- | drivers/media/pci/tw5864/tw5864-video.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/media/pci/tw5864/tw5864-video.c b/drivers/media/pci/tw5864/tw5864-video.c index ec1e06da7e4f..9131265c2b87 100644 --- a/drivers/media/pci/tw5864/tw5864-video.c +++ b/drivers/media/pci/tw5864/tw5864-video.c @@ -175,7 +175,7 @@ static const unsigned int intra4x4_lambda3[] = { static v4l2_std_id tw5864_get_v4l2_std(enum tw5864_vid_std std); static enum tw5864_vid_std tw5864_from_v4l2_std(v4l2_std_id v4l2_std); -static void tw5864_handle_frame_task(unsigned long data); +static void tw5864_handle_frame_task(struct tasklet_struct *t); static void tw5864_handle_frame(struct tw5864_h264_frame *frame); static void tw5864_frame_interval_set(struct tw5864_input *input); @@ -767,6 +767,9 @@ static int tw5864_enum_frameintervals(struct file *file, void *priv, fintv->type = V4L2_FRMIVAL_TYPE_STEPWISE; ret = tw5864_frameinterval_get(input, &frameinterval); + if (ret) + return ret; + fintv->stepwise.step = frameinterval; fintv->stepwise.min = frameinterval; fintv->stepwise.max = frameinterval; @@ -785,6 +788,9 @@ static int tw5864_g_parm(struct file *file, void *priv, cp->capability = V4L2_CAP_TIMEPERFRAME; ret = tw5864_frameinterval_get(input, &cp->timeperframe); + if (ret) + return ret; + cp->timeperframe.numerator *= input->frame_interval; cp->capturemode = 0; cp->readbuffers = 2; @@ -1057,8 +1063,7 @@ int tw5864_video_init(struct tw5864_dev *dev, int *video_nr) dev->irqmask |= TW5864_INTR_VLC_DONE | TW5864_INTR_TIMER; tw5864_irqmask_apply(dev); - tasklet_init(&dev->tasklet, tw5864_handle_frame_task, - (unsigned long)dev); + tasklet_setup(&dev->tasklet, tw5864_handle_frame_task); for (i = 0; i < TW5864_INPUTS; i++) { dev->inputs[i].root = dev; @@ -1178,7 +1183,6 @@ static int tw5864_video_input_init(struct tw5864_input *input, int video_nr) free_v4l2_hdl: v4l2_ctrl_handler_free(hdl); - vb2_queue_release(&input->vidq); free_mutex: mutex_destroy(&input->lock); @@ -1187,9 +1191,8 @@ free_mutex: static void tw5864_video_input_fini(struct tw5864_input *dev) { - video_unregister_device(&dev->vdev); + vb2_video_unregister_device(&dev->vdev); v4l2_ctrl_handler_free(&dev->hdl); - vb2_queue_release(&dev->vidq); } void tw5864_video_fini(struct tw5864_dev *dev) @@ -1313,9 +1316,9 @@ static int tw5864_is_motion_triggered(struct tw5864_h264_frame *frame) return detected; } -static void tw5864_handle_frame_task(unsigned long data) +static void tw5864_handle_frame_task(struct tasklet_struct *t) { - struct tw5864_dev *dev = (struct tw5864_dev *)data; + struct tw5864_dev *dev = from_tasklet(dev, t, tasklet); unsigned long flags; int batch_size = H264_BUF_CNT; |