summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-07-23 08:24:06 +0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-27 16:06:29 +0200
commitc6edaf1674d3c17770b1c9966306b802adb21a2b (patch)
tree8fd38319c6da57471f620c78a57ecb3b572ff372
parentV4L/DVB (8509): pvrusb2: fix device descriptions for HVR-1900 & HVR-1950 (diff)
downloadlinux-c6edaf1674d3c17770b1c9966306b802adb21a2b.tar.xz
linux-c6edaf1674d3c17770b1c9966306b802adb21a2b.zip
V4L/DVB (8511): gspca: Get the card name of QUERYCAP from the usb product name.
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>
-rw-r--r--drivers/media/video/gspca/gspca.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 2a416cf205aa..ab053a26023e 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -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;