Skip to content

Commit 68ee7a4

Browse files
author
Desnes Nunes
committed
media: uvcvideo: Drop the uvc_driver structure
JIRA: https://issues.redhat.com/browse/RHEL-78934 commit fd4f681 Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Date: Sun, 23 Feb 2025 17:01:32 +0200 The uvc_driver structure used to contain more fields, but those got removed in commit ba2fa99 ("[media] uvcvideo: Hardcode the index/selector relationship for XU controls"). The structure is now just a wrapper around usb_driver. Drop it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
1 parent 0f8233e commit 68ee7a4

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed

drivers/media/usb/uvc/uvc_driver.c

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ static unsigned int uvc_quirks_param = -1;
3737
unsigned int uvc_dbg_param;
3838
unsigned int uvc_timeout_param = UVC_CTRL_STREAMING_TIMEOUT;
3939

40+
static struct usb_driver uvc_driver;
41+
4042
/* ------------------------------------------------------------------------
4143
* Utility functions
4244
*/
@@ -546,7 +548,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
546548
return -EINVAL;
547549
}
548550

549-
if (usb_driver_claim_interface(&uvc_driver.driver, intf, dev)) {
551+
if (usb_driver_claim_interface(&uvc_driver, intf, dev)) {
550552
uvc_dbg(dev, DESCR,
551553
"device %d interface %d is already claimed\n",
552554
dev->udev->devnum,
@@ -556,7 +558,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
556558

557559
streaming = uvc_stream_new(dev, intf);
558560
if (streaming == NULL) {
559-
usb_driver_release_interface(&uvc_driver.driver, intf);
561+
usb_driver_release_interface(&uvc_driver, intf);
560562
return -ENOMEM;
561563
}
562564

@@ -779,7 +781,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
779781
return 0;
780782

781783
error:
782-
usb_driver_release_interface(&uvc_driver.driver, intf);
784+
usb_driver_release_interface(&uvc_driver, intf);
783785
uvc_stream_delete(streaming);
784786
return ret;
785787
}
@@ -1922,8 +1924,7 @@ static void uvc_delete(struct kref *kref)
19221924
struct uvc_streaming *streaming;
19231925

19241926
streaming = list_entry(p, struct uvc_streaming, list);
1925-
usb_driver_release_interface(&uvc_driver.driver,
1926-
streaming->intf);
1927+
usb_driver_release_interface(&uvc_driver, streaming->intf);
19271928
uvc_stream_delete(streaming);
19281929
}
19291930

@@ -3205,17 +3206,15 @@ static const struct usb_device_id uvc_ids[] = {
32053206

32063207
MODULE_DEVICE_TABLE(usb, uvc_ids);
32073208

3208-
struct uvc_driver uvc_driver = {
3209-
.driver = {
3210-
.name = "uvcvideo",
3211-
.probe = uvc_probe,
3212-
.disconnect = uvc_disconnect,
3213-
.suspend = uvc_suspend,
3214-
.resume = uvc_resume,
3215-
.reset_resume = uvc_reset_resume,
3216-
.id_table = uvc_ids,
3217-
.supports_autosuspend = 1,
3218-
},
3209+
static struct usb_driver uvc_driver = {
3210+
.name = "uvcvideo",
3211+
.probe = uvc_probe,
3212+
.disconnect = uvc_disconnect,
3213+
.suspend = uvc_suspend,
3214+
.resume = uvc_resume,
3215+
.reset_resume = uvc_reset_resume,
3216+
.id_table = uvc_ids,
3217+
.supports_autosuspend = 1,
32193218
};
32203219

32213220
static int __init uvc_init(void)
@@ -3224,7 +3223,7 @@ static int __init uvc_init(void)
32243223

32253224
uvc_debugfs_init();
32263225

3227-
ret = usb_register(&uvc_driver.driver);
3226+
ret = usb_register(&uvc_driver);
32283227
if (ret < 0) {
32293228
uvc_debugfs_cleanup();
32303229
return ret;
@@ -3235,7 +3234,7 @@ static int __init uvc_init(void)
32353234

32363235
static void __exit uvc_cleanup(void)
32373236
{
3238-
usb_deregister(&uvc_driver.driver);
3237+
usb_deregister(&uvc_driver);
32393238
uvc_debugfs_cleanup();
32403239
}
32413240

drivers/media/usb/uvc/uvcvideo.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,6 @@ struct uvc_fh {
632632
unsigned int pending_async_ctrls;
633633
};
634634

635-
struct uvc_driver {
636-
struct usb_driver driver;
637-
};
638-
639635
/* ------------------------------------------------------------------------
640636
* Debugging, printing and logging
641637
*/
@@ -686,9 +682,6 @@ do { \
686682
* Internal functions.
687683
*/
688684

689-
/* Core driver */
690-
extern struct uvc_driver uvc_driver;
691-
692685
struct uvc_entity *uvc_entity_by_id(struct uvc_device *dev, int id);
693686

694687
/* Video buffers queue management. */

0 commit comments

Comments
 (0)