summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-07-23 08:24:06 +0200
committerJean-Francois Moine <moinejf@free.fr>2008-07-23 08:24:06 +0200
commit3704c8e93fbb67c577b68ade395b963a83fa194d (patch)
tree63ca9dd9f50978a4031390834a912d1fe7ce2f65 /linux/drivers/media
parent4af3189282424ed07479ccfa87420d4fbb01b62e (diff)
downloadmediapointer-dvb-s2-3704c8e93fbb67c577b68ade395b963a83fa194d.tar.gz
mediapointer-dvb-s2-3704c8e93fbb67c577b68ade395b963a83fa194d.tar.bz2
gspca: Get the card name of QUERYCAP from the usb product name.
From: Jean-Francois Moine <moinejf@free.fr> 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>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/gspca/gspca.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c
index 729e0b4ed..99faae3df 100644
--- a/linux/drivers/media/video/gspca/gspca.c
+++ b/linux/drivers/media/video/gspca/gspca.c
@@ -841,7 +841,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;