diff options
author | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2023-01-27 00:14:56 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-31 09:40:43 +0100 |
commit | 2d83eb5d24e1c8dba386928fcbf76d3b581a632d (patch) | |
tree | 20b60a9cfea786ce45b84aed5b046e0f50890c8f /drivers/usb/gadget/function/uvc_v4l2.c | |
parent | usb: uvc: make uvc_format_desc table const (diff) | |
download | linux-2d83eb5d24e1c8dba386928fcbf76d3b581a632d.tar.xz linux-2d83eb5d24e1c8dba386928fcbf76d3b581a632d.zip |
usb: uvc: use v4l2_fill_fmtdesc instead of open coded format name
Since v4l2_fill_fmtdesc will be called in the ioctl v4l_enum_fmt anyway.
We can set the format description and compressed flag from v4l_fill_fmtdesc
and can remove the extra name field in uvc_format_desc.
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Tested-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20230126231456.3402323-6-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/function/uvc_v4l2.c')
-rw-r--r-- | drivers/usb/gadget/function/uvc_v4l2.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/usb/gadget/function/uvc_v4l2.c b/drivers/usb/gadget/function/uvc_v4l2.c index 21e573e628f4..3f0a9795c0d4 100644 --- a/drivers/usb/gadget/function/uvc_v4l2.c +++ b/drivers/usb/gadget/function/uvc_v4l2.c @@ -374,15 +374,9 @@ uvc_v4l2_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc *f) if (!uformat) return -EINVAL; - if (uformat->type != UVCG_UNCOMPRESSED) - f->flags |= V4L2_FMT_FLAG_COMPRESSED; - fmtdesc = to_uvc_format(uformat); f->pixelformat = fmtdesc->fcc; - strscpy(f->description, fmtdesc->name, sizeof(f->description)); - f->description[strlen(fmtdesc->name) - 1] = 0; - return 0; } |