]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (8511): gspca: Get the card name of QUERYCAP from the usb product name.
authorJean-Francois Moine <moinejf@free.fr>
Wed, 23 Jul 2008 06:24:06 +0000 (03:24 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 27 Jul 2008 14:06:29 +0000 (11:06 -0300)
This is a preliminary for using the driver_info of the struct
usb_device_id to handle the specific per webcam information.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/gspca/gspca.c

index 2a416cf205aafd18ff599ba24b5d5b10cc02df36..ab053a26023eab683c33c677db87fced2082710c 100644 (file)
@@ -834,7 +834,16 @@ static int vidioc_querycap(struct file *file, void  *priv,
 
        memset(cap, 0, sizeof *cap);
        strncpy(cap->driver, gspca_dev->sd_desc->name, sizeof cap->driver);
-       strncpy(cap->card, gspca_dev->cam.dev_name, sizeof cap->card);
+/*     strncpy(cap->card, gspca_dev->cam.dev_name, sizeof cap->card); */
+       if (gspca_dev->dev->product != NULL) {
+               strncpy(cap->card, gspca_dev->dev->product,
+                       sizeof cap->card);
+       } else {
+               snprintf(cap->card, sizeof cap->card,
+                       "USB Camera (%04x:%04x)",
+                       le16_to_cpu(gspca_dev->dev->descriptor.idVendor),
+                       le16_to_cpu(gspca_dev->dev->descriptor.idProduct));
+       }
        strncpy(cap->bus_info, gspca_dev->dev->bus->bus_name,
                sizeof cap->bus_info);
        cap->version = DRIVER_VERSION_NUMBER;