Commit ccfad4e8 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

media: uvcvideo: Rename uvc_streaming 'format' field to 'formats'

The uvc_streaming 'format' field points to an array of formats. Rename
it to 'formats' to make this clearer.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarRicardo Ribalda <ribalda@chromium.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent e33ae66a
...@@ -184,7 +184,7 @@ static void uvc_stream_delete(struct uvc_streaming *stream) ...@@ -184,7 +184,7 @@ static void uvc_stream_delete(struct uvc_streaming *stream)
usb_put_intf(stream->intf); usb_put_intf(stream->intf);
kfree(stream->format); kfree(stream->formats);
kfree(stream->header.bmaControls); kfree(stream->header.bmaControls);
kfree(stream); kfree(stream);
} }
...@@ -677,7 +677,7 @@ static int uvc_parse_streaming(struct uvc_device *dev, ...@@ -677,7 +677,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
frame = (struct uvc_frame *)&format[nformats]; frame = (struct uvc_frame *)&format[nformats];
interval = (u32 *)&frame[nframes]; interval = (u32 *)&frame[nframes];
streaming->format = format; streaming->formats = format;
streaming->nformats = 0; streaming->nformats = 0;
/* Parse the format descriptors. */ /* Parse the format descriptors. */
......
...@@ -235,7 +235,7 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream, ...@@ -235,7 +235,7 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
* format otherwise. * format otherwise.
*/ */
for (i = 0; i < stream->nformats; ++i) { for (i = 0; i < stream->nformats; ++i) {
format = &stream->format[i]; format = &stream->formats[i];
if (format->fcc == fmt->fmt.pix.pixelformat) if (format->fcc == fmt->fmt.pix.pixelformat)
break; break;
} }
...@@ -319,8 +319,8 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream, ...@@ -319,8 +319,8 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
* accepted the requested format as-is. * accepted the requested format as-is.
*/ */
for (i = 0; i < stream->nformats; ++i) { for (i = 0; i < stream->nformats; ++i) {
if (probe->bFormatIndex == stream->format[i].index) { if (probe->bFormatIndex == stream->formats[i].index) {
format = &stream->format[i]; format = &stream->formats[i];
break; break;
} }
} }
...@@ -708,7 +708,7 @@ static int uvc_ioctl_enum_fmt(struct uvc_streaming *stream, ...@@ -708,7 +708,7 @@ static int uvc_ioctl_enum_fmt(struct uvc_streaming *stream,
fmt->index = index; fmt->index = index;
fmt->type = type; fmt->type = type;
format = &stream->format[fmt->index]; format = &stream->formats[fmt->index];
fmt->flags = 0; fmt->flags = 0;
if (format->flags & UVC_FMT_FLAG_COMPRESSED) if (format->flags & UVC_FMT_FLAG_COMPRESSED)
fmt->flags |= V4L2_FMT_FLAG_COMPRESSED; fmt->flags |= V4L2_FMT_FLAG_COMPRESSED;
...@@ -1256,8 +1256,8 @@ static int uvc_ioctl_enum_framesizes(struct file *file, void *fh, ...@@ -1256,8 +1256,8 @@ static int uvc_ioctl_enum_framesizes(struct file *file, void *fh,
/* Look for the given pixel format */ /* Look for the given pixel format */
for (i = 0; i < stream->nformats; i++) { for (i = 0; i < stream->nformats; i++) {
if (stream->format[i].fcc == fsize->pixel_format) { if (stream->formats[i].fcc == fsize->pixel_format) {
format = &stream->format[i]; format = &stream->formats[i];
break; break;
} }
} }
...@@ -1297,8 +1297,8 @@ static int uvc_ioctl_enum_frameintervals(struct file *file, void *fh, ...@@ -1297,8 +1297,8 @@ static int uvc_ioctl_enum_frameintervals(struct file *file, void *fh,
/* Look for the given pixel format and frame size */ /* Look for the given pixel format and frame size */
for (i = 0; i < stream->nformats; i++) { for (i = 0; i < stream->nformats; i++) {
if (stream->format[i].fcc == fival->pixel_format) { if (stream->formats[i].fcc == fival->pixel_format) {
format = &stream->format[i]; format = &stream->formats[i];
break; break;
} }
} }
......
...@@ -166,8 +166,8 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream, ...@@ -166,8 +166,8 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream,
} }
for (i = 0; i < stream->nformats; ++i) { for (i = 0; i < stream->nformats; ++i) {
if (stream->format[i].index == ctrl->bFormatIndex) { if (stream->formats[i].index == ctrl->bFormatIndex) {
format = &stream->format[i]; format = &stream->formats[i];
break; break;
} }
} }
...@@ -2161,7 +2161,7 @@ int uvc_video_init(struct uvc_streaming *stream) ...@@ -2161,7 +2161,7 @@ int uvc_video_init(struct uvc_streaming *stream)
* available format otherwise. * available format otherwise.
*/ */
for (i = stream->nformats; i > 0; --i) { for (i = stream->nformats; i > 0; --i) {
format = &stream->format[i-1]; format = &stream->formats[i-1];
if (format->index == probe->bFormatIndex) if (format->index == probe->bFormatIndex)
break; break;
} }
......
...@@ -438,7 +438,7 @@ struct uvc_streaming { ...@@ -438,7 +438,7 @@ struct uvc_streaming {
enum v4l2_buf_type type; enum v4l2_buf_type type;
unsigned int nformats; unsigned int nformats;
struct uvc_format *format; struct uvc_format *formats;
struct uvc_streaming_control ctrl; struct uvc_streaming_control ctrl;
struct uvc_format *def_format; struct uvc_format *def_format;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment