Skip to content

Commit 81c2524

Browse files
djrscallygregkh
authored andcommitted
usb: gadget: uvc: Rename bmInterfaceFlags -> bmInterlaceFlags
In the specification documents for the Uncompressed and MJPEG USB Video Payloads, the field name is bmInterlaceFlags - it has been misnamed within the kernel. Although renaming the field does break the kernel's interface to userspace it should be low-risk in this instance. The field is read only and hardcoded to 0, so there was never any value in anyone reading it. A search of the uvc-gadget application and all the forks that I could find for it did not reveal any users either. Fixes: cdda479 ("USB gadget: video class function driver") Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Daniel Scally <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ade23d7 commit 81c2524

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Documentation/ABI/testing/configfs-usb-gadget-uvc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Description: Specific MJPEG format descriptors
197197
read-only
198198
bmaControls this format's data for bmaControls in
199199
the streaming header
200-
bmInterfaceFlags specifies interlace information,
200+
bmInterlaceFlags specifies interlace information,
201201
read-only
202202
bAspectRatioY the X dimension of the picture aspect
203203
ratio, read-only
@@ -253,7 +253,7 @@ Description: Specific uncompressed format descriptors
253253
read-only
254254
bmaControls this format's data for bmaControls in
255255
the streaming header
256-
bmInterfaceFlags specifies interlace information,
256+
bmInterlaceFlags specifies interlace information,
257257
read-only
258258
bAspectRatioY the X dimension of the picture aspect
259259
ratio, read-only

drivers/usb/gadget/function/uvc_configfs.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,7 @@ UVCG_UNCOMPRESSED_ATTR(b_bits_per_pixel, bBitsPerPixel, 8);
15121512
UVCG_UNCOMPRESSED_ATTR(b_default_frame_index, bDefaultFrameIndex, 8);
15131513
UVCG_UNCOMPRESSED_ATTR_RO(b_aspect_ratio_x, bAspectRatioX, 8);
15141514
UVCG_UNCOMPRESSED_ATTR_RO(b_aspect_ratio_y, bAspectRatioY, 8);
1515-
UVCG_UNCOMPRESSED_ATTR_RO(bm_interface_flags, bmInterfaceFlags, 8);
1515+
UVCG_UNCOMPRESSED_ATTR_RO(bm_interlace_flags, bmInterlaceFlags, 8);
15161516

15171517
#undef UVCG_UNCOMPRESSED_ATTR
15181518
#undef UVCG_UNCOMPRESSED_ATTR_RO
@@ -1541,7 +1541,7 @@ static struct configfs_attribute *uvcg_uncompressed_attrs[] = {
15411541
&uvcg_uncompressed_attr_b_default_frame_index,
15421542
&uvcg_uncompressed_attr_b_aspect_ratio_x,
15431543
&uvcg_uncompressed_attr_b_aspect_ratio_y,
1544-
&uvcg_uncompressed_attr_bm_interface_flags,
1544+
&uvcg_uncompressed_attr_bm_interlace_flags,
15451545
&uvcg_uncompressed_attr_bma_controls,
15461546
NULL,
15471547
};
@@ -1574,7 +1574,7 @@ static struct config_group *uvcg_uncompressed_make(struct config_group *group,
15741574
h->desc.bDefaultFrameIndex = 1;
15751575
h->desc.bAspectRatioX = 0;
15761576
h->desc.bAspectRatioY = 0;
1577-
h->desc.bmInterfaceFlags = 0;
1577+
h->desc.bmInterlaceFlags = 0;
15781578
h->desc.bCopyProtect = 0;
15791579

15801580
INIT_LIST_HEAD(&h->fmt.frames);
@@ -1700,7 +1700,7 @@ UVCG_MJPEG_ATTR(b_default_frame_index, bDefaultFrameIndex, 8);
17001700
UVCG_MJPEG_ATTR_RO(bm_flags, bmFlags, 8);
17011701
UVCG_MJPEG_ATTR_RO(b_aspect_ratio_x, bAspectRatioX, 8);
17021702
UVCG_MJPEG_ATTR_RO(b_aspect_ratio_y, bAspectRatioY, 8);
1703-
UVCG_MJPEG_ATTR_RO(bm_interface_flags, bmInterfaceFlags, 8);
1703+
UVCG_MJPEG_ATTR_RO(bm_interlace_flags, bmInterlaceFlags, 8);
17041704

17051705
#undef UVCG_MJPEG_ATTR
17061706
#undef UVCG_MJPEG_ATTR_RO
@@ -1728,7 +1728,7 @@ static struct configfs_attribute *uvcg_mjpeg_attrs[] = {
17281728
&uvcg_mjpeg_attr_bm_flags,
17291729
&uvcg_mjpeg_attr_b_aspect_ratio_x,
17301730
&uvcg_mjpeg_attr_b_aspect_ratio_y,
1731-
&uvcg_mjpeg_attr_bm_interface_flags,
1731+
&uvcg_mjpeg_attr_bm_interlace_flags,
17321732
&uvcg_mjpeg_attr_bma_controls,
17331733
NULL,
17341734
};
@@ -1755,7 +1755,7 @@ static struct config_group *uvcg_mjpeg_make(struct config_group *group,
17551755
h->desc.bDefaultFrameIndex = 1;
17561756
h->desc.bAspectRatioX = 0;
17571757
h->desc.bAspectRatioY = 0;
1758-
h->desc.bmInterfaceFlags = 0;
1758+
h->desc.bmInterlaceFlags = 0;
17591759
h->desc.bCopyProtect = 0;
17601760

17611761
INIT_LIST_HEAD(&h->fmt.frames);

drivers/usb/gadget/legacy/webcam.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static const struct uvc_format_uncompressed uvc_format_yuv = {
171171
.bDefaultFrameIndex = 1,
172172
.bAspectRatioX = 0,
173173
.bAspectRatioY = 0,
174-
.bmInterfaceFlags = 0,
174+
.bmInterlaceFlags = 0,
175175
.bCopyProtect = 0,
176176
};
177177

@@ -222,7 +222,7 @@ static const struct uvc_format_mjpeg uvc_format_mjpg = {
222222
.bDefaultFrameIndex = 1,
223223
.bAspectRatioX = 0,
224224
.bAspectRatioY = 0,
225-
.bmInterfaceFlags = 0,
225+
.bmInterlaceFlags = 0,
226226
.bCopyProtect = 0,
227227
};
228228

include/uapi/linux/usb/video.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ struct uvc_format_uncompressed {
466466
__u8 bDefaultFrameIndex;
467467
__u8 bAspectRatioX;
468468
__u8 bAspectRatioY;
469-
__u8 bmInterfaceFlags;
469+
__u8 bmInterlaceFlags;
470470
__u8 bCopyProtect;
471471
} __attribute__((__packed__));
472472

@@ -522,7 +522,7 @@ struct uvc_format_mjpeg {
522522
__u8 bDefaultFrameIndex;
523523
__u8 bAspectRatioX;
524524
__u8 bAspectRatioY;
525-
__u8 bmInterfaceFlags;
525+
__u8 bmInterlaceFlags;
526526
__u8 bCopyProtect;
527527
} __attribute__((__packed__));
528528

0 commit comments

Comments
 (0)