V4L/DVB (9767): em28xx: improve board description messages
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 29 Nov 2008 02:46:43 +0000 (23:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 29 Dec 2008 19:53:43 +0000 (17:53 -0200)
Print manufacturer/product info from USB device and also card entry.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/em28xx/em28xx-cards.c
drivers/media/video/em28xx/em28xx-video.c

index a8c815728a284adb0a50f7ee5063a62c341d6a6b..01757c018b5e3463556472205ea3c0240453029a 100644 (file)
@@ -1354,7 +1354,8 @@ void em28xx_pre_card_setup(struct em28xx *dev)
 
        em28xx_set_model(dev);
 
-       em28xx_info("Found %s\n", dev->board.name);
+       em28xx_info("Identified as %s (card=%d)\n",
+                   dev->board.name, dev->model);
 
        /* Set the default GPO/GPIO for legacy devices */
        dev->reg_gpo_num = EM2880_R04_GPO;
index a0db340e5eb9a134cad1d11dbc3fed854ebcd88a..32b437fd7936824866bb15245a14302b039090a0 100644 (file)
@@ -2177,6 +2177,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
        int retval = -ENODEV;
        int i, nr, ifnum, isoc_pipe;
        char *speed;
+       char descr[255] = "";
 
        udev = usb_get_dev(interface_to_usbdev(interface));
        ifnum = interface->altsetting[0].desc.bInterfaceNumber;
@@ -2249,8 +2250,20 @@ static int em28xx_usb_probe(struct usb_interface *interface,
                speed = "unknown";
        }
 
-       printk(DRIVER_NAME ": New video device @ %s Mbps "
+       if (udev->manufacturer)
+               strlcpy(descr, udev->manufacturer, sizeof(descr));
+
+       if (udev->product) {
+               if (*descr)
+                       strlcat(descr, " ", sizeof(descr));
+               strlcat(descr, udev->product, sizeof(descr));
+       }
+       if (*descr)
+               strlcat(descr, " ", sizeof(descr));
+
+       printk(DRIVER_NAME ": New device %s@ %s Mbps "
                "(%04x:%04x, interface %d, class %d)\n",
+               descr,
                speed,
                le16_to_cpu(udev->descriptor.idVendor),
                le16_to_cpu(udev->descriptor.idProduct),