Message ID | 20190626074421.38739-16-hverkuil-cisco@xs4all.nl (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | media/platform: set device_caps in struct video_device | expand |
Acked-by: Benoit Parrot <bparrot@ti.com> Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote on Wed [2019-Jun-26 09:44:20 +0200]: > Instead of filling in the struct v4l2_capability device_caps > field, fill in the struct video_device device_caps field. > > That way the V4L2 core knows what the capabilities of the > video device are. > > Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> > Cc: Benoit Parrot <bparrot@ti.com> > --- > drivers/media/platform/ti-vpe/cal.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c > index 8d075683e448..3fa306a45787 100644 > --- a/drivers/media/platform/ti-vpe/cal.c > +++ b/drivers/media/platform/ti-vpe/cal.c > @@ -916,9 +916,6 @@ static int cal_querycap(struct file *file, void *priv, > > snprintf(cap->bus_info, sizeof(cap->bus_info), > "platform:%s", ctx->v4l2_dev.name); > - cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | > - V4L2_CAP_READWRITE; > - cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; > return 0; > } > > @@ -1422,6 +1419,8 @@ static const struct video_device cal_videodev = { > .ioctl_ops = &cal_ioctl_ops, > .minor = -1, > .release = video_device_release_empty, > + .device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | > + V4L2_CAP_READWRITE, > }; > > /* ----------------------------------------------------------------- > -- > 2.20.1 >
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index 8d075683e448..3fa306a45787 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c @@ -916,9 +916,6 @@ static int cal_querycap(struct file *file, void *priv, snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", ctx->v4l2_dev.name); - cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | - V4L2_CAP_READWRITE; - cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } @@ -1422,6 +1419,8 @@ static const struct video_device cal_videodev = { .ioctl_ops = &cal_ioctl_ops, .minor = -1, .release = video_device_release_empty, + .device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | + V4L2_CAP_READWRITE, }; /* -----------------------------------------------------------------
Instead of filling in the struct v4l2_capability device_caps field, fill in the struct video_device device_caps field. That way the V4L2 core knows what the capabilities of the video device are. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Cc: Benoit Parrot <bparrot@ti.com> --- drivers/media/platform/ti-vpe/cal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)