This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-dvb.git tree:

Subject: V4L/DVB: gspca - main: Function gspca_dev_probe2 added
Author:  Jean-François Moine <[email protected]>
Date:    Sat Jun 5 07:47:36 2010 -0300

This function is used when the USB video interface is checked by
the subdriver.

Signed-off-by: Jean-François Moine <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/video/gspca/gspca.c |   46 +++++++++++++++++++++++++------------
 drivers/media/video/gspca/gspca.h |    5 ++++
 2 files changed, 36 insertions(+), 15 deletions(-)

---

http://git.linuxtv.org/v4l-dvb.git?a=commitdiff;h=26803e4e672711193f186cebdc613d0d977dc6c5

diff --git a/drivers/media/video/gspca/gspca.c 
b/drivers/media/video/gspca/gspca.c
index efe6159..a1901ba 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -2253,31 +2253,18 @@ static struct video_device gspca_template = {
  * This function must be called by the sub-driver when it is
  * called for probing a new device.
  */
-int gspca_dev_probe(struct usb_interface *intf,
+int gspca_dev_probe2(struct usb_interface *intf,
                const struct usb_device_id *id,
                const struct sd_desc *sd_desc,
                int dev_size,
                struct module *module)
 {
-       struct usb_interface_descriptor *interface;
        struct gspca_dev *gspca_dev;
        struct usb_device *dev = interface_to_usbdev(intf);
        int ret;
 
        PDEBUG(D_PROBE, "probing %04x:%04x", id->idVendor, id->idProduct);
 
-       /* we don't handle multi-config cameras */
-       if (dev->descriptor.bNumConfigurations != 1) {
-               PDEBUG(D_ERR, "Too many config");
-               return -ENODEV;
-       }
-
-       /* the USB video interface must be the first one */
-       interface = &intf->cur_altsetting->desc;
-       if (dev->config->desc.bNumInterfaces != 1 &&
-           interface->bInterfaceNumber != 0)
-               return -ENODEV;
-
        /* create the device */
        if (dev_size < sizeof *gspca_dev)
                dev_size = sizeof *gspca_dev;
@@ -2293,7 +2280,7 @@ int gspca_dev_probe(struct usb_interface *intf,
                goto out;
        }
        gspca_dev->dev = dev;
-       gspca_dev->iface = interface->bInterfaceNumber;
+       gspca_dev->iface = intf->cur_altsetting->desc.bInterfaceNumber;
        gspca_dev->nbalt = intf->num_altsetting;
        gspca_dev->sd_desc = sd_desc;
        gspca_dev->nbufread = 2;
@@ -2345,6 +2332,35 @@ out:
        kfree(gspca_dev);
        return ret;
 }
+EXPORT_SYMBOL(gspca_dev_probe2);
+
+/* same function as the previous one, but check the interface */
+int gspca_dev_probe(struct usb_interface *intf,
+               const struct usb_device_id *id,
+               const struct sd_desc *sd_desc,
+               int dev_size,
+               struct module *module)
+{
+       struct usb_device *dev = interface_to_usbdev(intf);
+
+       /* we don't handle multi-config cameras */
+       if (dev->descriptor.bNumConfigurations != 1) {
+               PDEBUG(D_ERR, "%04x:%04x too many config",
+                               id->idVendor, id->idProduct);
+               return -ENODEV;
+       }
+
+       /* the USB video interface must be the first one */
+       if (dev->config->desc.bNumInterfaces != 1
+        && intf->cur_altsetting->desc.bInterfaceNumber != 0) {
+               PDEBUG(D_ERR, "%04x:%04x bad interface %d",
+                               id->idVendor, id->idProduct,
+                               intf->cur_altsetting->desc.bInterfaceNumber);
+               return -ENODEV;
+       }
+
+       return gspca_dev_probe2(intf, id, sd_desc, dev_size, module);
+}
 EXPORT_SYMBOL(gspca_dev_probe);
 
 /*
diff --git a/drivers/media/video/gspca/gspca.h 
b/drivers/media/video/gspca/gspca.h
index 8b963df..3215e42 100644
--- a/drivers/media/video/gspca/gspca.h
+++ b/drivers/media/video/gspca/gspca.h
@@ -217,6 +217,11 @@ int gspca_dev_probe(struct usb_interface *intf,
                const struct sd_desc *sd_desc,
                int dev_size,
                struct module *module);
+int gspca_dev_probe2(struct usb_interface *intf,
+               const struct usb_device_id *id,
+               const struct sd_desc *sd_desc,
+               int dev_size,
+               struct module *module);
 void gspca_disconnect(struct usb_interface *intf);
 void gspca_frame_add(struct gspca_dev *gspca_dev,
                        enum gspca_packet_type packet_type,

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to