]> Pileus Git - ~andy/linux/blobdiff - drivers/media/video/gspca/gspca.c
[media] gspca - main: Display the subdriver name and version at probe time
[~andy/linux] / drivers / media / video / gspca / gspca.c
index ee9544894e8b4ce98339617a90b6cdf0dddb1a41..881e04c7ffe6dd91f5a96f12aaebe236a7bfba5c 100644 (file)
@@ -23,7 +23,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#define MODULE_NAME "gspca"
+#define GSPCA_VERSION  "2.14.0"
 
 #include <linux/init.h>
 #include <linux/fs.h>
 #error "DEF_NURBS too big"
 #endif
 
-#define DRIVER_VERSION_NUMBER  "2.13.0"
-
 MODULE_AUTHOR("Jean-François Moine <http://moinejf.free.fr>");
 MODULE_DESCRIPTION("GSPCA USB Camera Driver");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(DRIVER_VERSION_NUMBER);
+MODULE_VERSION(GSPCA_VERSION);
 
 #ifdef GSPCA_DEBUG
 int gspca_debug = D_ERR | D_PROBE;
@@ -887,6 +885,8 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
                                                        gspca_dev->iface,
                                                        alt);
                                if (ret < 0) {
+                                       if (ret == -ENOSPC)
+                                               goto retry; /*fixme: ugly*/
                                        pr_err("set alt %d err %d\n", alt, ret);
                                        goto out;
                                }
@@ -942,6 +942,7 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
 
                /* the bandwidth is not wide enough
                 * negotiate or try a lower alternate setting */
+retry:
                PDEBUG(D_ERR|D_STREAM,
                        "alt %d - bandwidth not wide enough - trying again",
                        alt);
@@ -2280,7 +2281,8 @@ int gspca_dev_probe2(struct usb_interface *intf,
        struct usb_device *dev = interface_to_usbdev(intf);
        int ret;
 
-       PDEBUG(D_PROBE, "probing %04x:%04x", id->idVendor, id->idProduct);
+       pr_info("%s-" GSPCA_VERSION " probing %04x:%04x\n",
+               sd_desc->name, id->idVendor, id->idProduct);
 
        /* create the device */
        if (dev_size < sizeof *gspca_dev)
@@ -2565,7 +2567,7 @@ EXPORT_SYMBOL(gspca_auto_gain_n_exposure);
 /* -- module insert / remove -- */
 static int __init gspca_init(void)
 {
-       pr_info("v" DRIVER_VERSION_NUMBER " registered\n");
+       pr_info("v" GSPCA_VERSION " registered\n");
        return 0;
 }
 static void __exit gspca_exit(void)