Commit 4f70b416 authored by Simon Evans's avatar Simon Evans Committed by Greg Kroah-Hartman

[PATCH] 2.5.12 - make usbvideo_register take a usb_device_id table

This patch makes 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.
parent 1eb9c838
......@@ -3899,6 +3899,17 @@ static void *ibmcam_probe(struct usb_device *dev, unsigned int ifnum, const stru
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 @@ static int __init ibmcam_init(void)
sizeof(ibmcam_t),
"ibmcam",
&cbTbl,
THIS_MODULE);
THIS_MODULE,
id_table);
}
static void __exit ibmcam_cleanup(void)
......@@ -3934,15 +3946,6 @@ static void __exit ibmcam_cleanup(void)
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);
......
......@@ -767,7 +767,8 @@ static int __init konicawc_init(void)
sizeof(struct konicawc),
"konicawc",
&cbTbl,
THIS_MODULE);
THIS_MODULE,
id_table);
}
......
......@@ -659,6 +659,12 @@ static void *ultracam_probe(struct usb_device *dev, unsigned int ifnum ,const st
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 @@ static int __init ultracam_init(void)
sizeof(ultracam_t),
"ultracam",
&cbTbl,
THIS_MODULE);
THIS_MODULE,
id_table);
}
static void __exit ultracam_cleanup(void)
......@@ -690,16 +697,7 @@ static void __exit ultracam_cleanup(void)
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);
......
......@@ -749,7 +749,8 @@ int usbvideo_register(
const int num_extra,
const char *driverName,
const usbvideo_cb_t *cbTbl,
struct module *md )
struct module *md,
const struct usb_device_id *id_table)
{
static const char proc[] = "usbvideo_register";
usbvideo_t *cams;
......@@ -839,6 +840,7 @@ int usbvideo_register(
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) {
......
......@@ -327,7 +327,8 @@ int usbvideo_register(
const int num_extra,
const char *driverName,
const usbvideo_cb_t *cbTable,
struct module *md);
struct module *md,
const struct usb_device_id *id_table);
uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams);
int usbvideo_RegisterVideoDevice(uvd_t *uvd);
void usbvideo_Deregister(usbvideo_t **uvt);
......
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