aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/cpia2/cpia2_v4l.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-06-11 09:48:54 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-07-22 14:01:05 -0400
commit009cb7d5794aaf40b037857510c59847298747dd (patch)
treed19ba5b440a8ef4c75d81830f22e32e9adffbe21 /drivers/media/usb/cpia2/cpia2_v4l.c
parentmedia: v4l2-ioctl: add missing pixelformats (diff)
downloadlinux-dev-009cb7d5794aaf40b037857510c59847298747dd.tar.xz
linux-dev-009cb7d5794aaf40b037857510c59847298747dd.zip
media: media/usb: don't set description in ENUM_FMT
The V4L2 core sets the description for the driver in order to ensure consistent naming. So drop the strscpy of the description in drivers. Also remove any description strings in driver-internal structures since those are no longer needed. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/usb/cpia2/cpia2_v4l.c')
-rw-r--r--drivers/media/usb/cpia2/cpia2_v4l.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/media/usb/cpia2/cpia2_v4l.c b/drivers/media/usb/cpia2/cpia2_v4l.c
index 0feae825cebb..ded7eb2dc40a 100644
--- a/drivers/media/usb/cpia2/cpia2_v4l.c
+++ b/drivers/media/usb/cpia2/cpia2_v4l.c
@@ -292,28 +292,13 @@ static int cpia2_s_input(struct file *file, void *fh, unsigned int i)
static int cpia2_enum_fmt_vid_cap(struct file *file, void *fh,
struct v4l2_fmtdesc *f)
{
- int index = f->index;
-
- if (index < 0 || index > 1)
- return -EINVAL;
+ if (f->index > 1)
+ return -EINVAL;
- memset(f, 0, sizeof(*f));
- f->index = index;
- f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- f->flags = V4L2_FMT_FLAG_COMPRESSED;
- switch(index) {
- case 0:
- strscpy(f->description, "MJPEG", sizeof(f->description));
+ if (f->index == 0)
f->pixelformat = V4L2_PIX_FMT_MJPEG;
- break;
- case 1:
- strscpy(f->description, "JPEG", sizeof(f->description));
+ else
f->pixelformat = V4L2_PIX_FMT_JPEG;
- break;
- default:
- return -EINVAL;
- }
-
return 0;
}