ChangeSet 1.893.2.20, 2002/12/26 18:54:18-08:00, spse@secret.org.uk [PATCH] 2.4.20 usbvideo fixes from 2.5 5/5 Make usbvideo_register take a usb_device_id argument which it can then pass to usb_register via the struct usb_device. Currently it passes NULL. diff -Nru a/drivers/usb/ibmcam.c b/drivers/usb/ibmcam.c --- a/drivers/usb/ibmcam.c Mon Jan 6 11:30:11 2003 +++ b/drivers/usb/ibmcam.c Mon Jan 6 11:30:11 2003 @@ -3899,6 +3899,17 @@ return uvd; } + +static struct usb_device_id id_table[] = { + { USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x0002, 0x0002) }, /* Model 1 */ + { USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 2 */ + { USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x0301, 0x0301) }, /* Model 3 */ + { USB_DEVICE_VER(IBMCAM_VENDOR_ID, NETCAM_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 4 */ + { USB_DEVICE_VER(IBMCAM_VENDOR_ID, VEO_800C_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 2 */ + { USB_DEVICE_VER(IBMCAM_VENDOR_ID, VEO_800D_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 4 */ + { } /* Terminating entry */ +}; + /* * ibmcam_init() * @@ -3926,7 +3937,8 @@ sizeof(ibmcam_t), "ibmcam", &cbTbl, - THIS_MODULE); + THIS_MODULE, + id_table); } static void __exit ibmcam_cleanup(void) @@ -3934,15 +3946,6 @@ usbvideo_Deregister(&cams); } -static __devinitdata struct usb_device_id id_table[] = { - { USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x0002, 0x0002) }, /* Model 1 */ - { USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 2 */ - { USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x0301, 0x0301) }, /* Model 3 */ - { USB_DEVICE_VER(IBMCAM_VENDOR_ID, NETCAM_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 4 */ - { USB_DEVICE_VER(IBMCAM_VENDOR_ID, VEO_800C_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 2 */ - { USB_DEVICE_VER(IBMCAM_VENDOR_ID, VEO_800D_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 4 */ - { } /* Terminating entry */ -}; MODULE_DEVICE_TABLE(usb, id_table); module_init(ibmcam_init); diff -Nru a/drivers/usb/ultracam.c b/drivers/usb/ultracam.c --- a/drivers/usb/ultracam.c Mon Jan 6 11:30:11 2003 +++ b/drivers/usb/ultracam.c Mon Jan 6 11:30:11 2003 @@ -659,6 +659,12 @@ return uvd; } + +static struct usb_device_id id_table[] = { + { USB_DEVICE(ULTRACAM_VENDOR_ID, ULTRACAM_PRODUCT_ID) }, + { } /* Terminating entry */ +}; + /* * ultracam_init() * @@ -682,7 +688,8 @@ sizeof(ultracam_t), "ultracam", &cbTbl, - THIS_MODULE); + THIS_MODULE, + id_table); } static void __exit ultracam_cleanup(void) @@ -690,16 +697,7 @@ usbvideo_Deregister(&cams); } -#if defined(usb_device_id_ver) - -static __devinitdata struct usb_device_id id_table[] = { - { USB_DEVICE(ULTRACAM_VENDOR_ID, ULTRACAM_PRODUCT_ID) }, - { } /* Terminating entry */ -}; MODULE_DEVICE_TABLE(usb, id_table); - - -#endif /* defined(usb_device_id_ver) */ MODULE_LICENSE("GPL"); module_init(ultracam_init); diff -Nru a/drivers/usb/usbvideo.c b/drivers/usb/usbvideo.c --- a/drivers/usb/usbvideo.c Mon Jan 6 11:30:11 2003 +++ b/drivers/usb/usbvideo.c Mon Jan 6 11:30:11 2003 @@ -736,7 +736,8 @@ const int num_extra, const char *driverName, const struct usbvideo_cb *cbTbl, - struct module *md ) + struct module *md, + const struct usb_device_id *id_table) { struct usbvideo *cams; int i, base_size; @@ -825,6 +826,7 @@ cams->usbdrv.name = cams->drvName; cams->usbdrv.probe = cams->cb.probe; cams->usbdrv.disconnect = cams->cb.disconnect; + cams->usbdrv.id_table = id_table; #if USES_PROC_FS if (cams->uses_procfs) { diff -Nru a/drivers/usb/usbvideo.h b/drivers/usb/usbvideo.h --- a/drivers/usb/usbvideo.h Mon Jan 6 11:30:11 2003 +++ b/drivers/usb/usbvideo.h Mon Jan 6 11:30:11 2003 @@ -346,7 +346,8 @@ const int num_extra, const char *driverName, const struct usbvideo_cb *cbTable, - struct module *md); + struct module *md, + const struct usb_device_id *id_table); struct uvd *usbvideo_AllocateDevice(struct usbvideo *cams); int usbvideo_RegisterVideoDevice(struct uvd *uvd); void usbvideo_Deregister(struct usbvideo **uvt);