aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/v4l2-ioctl.c')
-rw-r--r--drivers/media/video/v4l2-ioctl.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index be64a502ea2..f2afc4e0837 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -1081,8 +1081,10 @@ static long __video_do_ioctl(struct file *file,
1081 /* Calls the specific handler */ 1081 /* Calls the specific handler */
1082 if (ops->vidioc_g_std) 1082 if (ops->vidioc_g_std)
1083 ret = ops->vidioc_g_std(file, fh, id); 1083 ret = ops->vidioc_g_std(file, fh, id);
1084 else 1084 else if (vfd->current_norm)
1085 *id = vfd->current_norm; 1085 *id = vfd->current_norm;
1086 else
1087 ret = -EINVAL;
1086 1088
1087 if (!ret) 1089 if (!ret)
1088 dbgarg(cmd, "std=0x%08Lx\n", (long long unsigned)*id); 1090 dbgarg(cmd, "std=0x%08Lx\n", (long long unsigned)*id);
@@ -1553,12 +1555,19 @@ static long __video_do_ioctl(struct file *file,
1553 break; 1555 break;
1554 ret = ops->vidioc_g_parm(file, fh, p); 1556 ret = ops->vidioc_g_parm(file, fh, p);
1555 } else { 1557 } else {
1558 v4l2_std_id std = vfd->current_norm;
1559
1556 if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 1560 if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
1557 return -EINVAL; 1561 return -EINVAL;
1558 1562
1559 v4l2_video_std_frame_period(vfd->current_norm,
1560 &p->parm.capture.timeperframe);
1561 ret = 0; 1563 ret = 0;
1564 if (ops->vidioc_g_std)
1565 ret = ops->vidioc_g_std(file, fh, &std);
1566 else if (std == 0)
1567 ret = -EINVAL;
1568 if (ret == 0)
1569 v4l2_video_std_frame_period(std,
1570 &p->parm.capture.timeperframe);
1562 } 1571 }
1563 1572
1564 dbgarg(cmd, "type=%d\n", p->type); 1573 dbgarg(cmd, "type=%d\n", p->type);