Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: uvcvideo: Use intf instead of udev for printks

The UVC driver is a usb_interface driver. Use the correct device for
printks to avoid confusions with other interface drivers associated to
the same usb device.

With this change:
uvcvideo 3-6:1.0: Found UVC 1.10 device USB2.0 WebCam (1234:abcd)

Without this change:
usb 3-6: Found UVC 1.10 device USB2.0 WebCam (1234:abcd)

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans de Goede <hansg@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Ricardo Ribalda and committed by
Hans Verkuil
5cdbca89 3e412a7b

+24 -24
+5 -5
drivers/media/usb/uvc/uvc_ctrl.c
··· 1619 1619 } 1620 1620 1621 1621 if (ret == -EIO) { 1622 - dev_warn_ratelimited(&chain->dev->udev->dev, 1622 + dev_warn_ratelimited(&chain->dev->intf->dev, 1623 1623 "UVC non compliance: Error %d querying master control %x (%s)\n", 1624 1624 ret, master_map->id, 1625 1625 uvc_map_get_name(master_map)); ··· 1643 1643 1644 1644 ret = __uvc_queryctrl_boundaries(chain, ctrl, mapping, v4l2_ctrl); 1645 1645 if (ret && !mapping->disabled) { 1646 - dev_warn(&chain->dev->udev->dev, 1646 + dev_warn(&chain->dev->intf->dev, 1647 1647 "UVC non compliance: permanently disabling control %x (%s), due to error %d\n", 1648 1648 mapping->id, uvc_map_get_name(mapping), ret); 1649 1649 mapping->disabled = true; ··· 1858 1858 lockdep_assert_held(&handle->chain->ctrl_mutex); 1859 1859 1860 1860 if (ctrl->handle) { 1861 - dev_warn_ratelimited(&handle->stream->dev->udev->dev, 1861 + dev_warn_ratelimited(&handle->stream->dev->intf->dev, 1862 1862 "UVC non compliance: Setting an async control with a pending operation."); 1863 1863 1864 1864 if (ctrl->handle == handle) ··· 1956 1956 w->urb->interval = dev->int_ep->desc.bInterval; 1957 1957 ret = usb_submit_urb(w->urb, GFP_KERNEL); 1958 1958 if (ret < 0) 1959 - dev_err(&dev->udev->dev, 1959 + dev_err(&dev->intf->dev, 1960 1960 "Failed to resubmit status URB (%d).\n", ret); 1961 1961 } 1962 1962 ··· 2895 2895 if (!ctrl->initialized || !ctrl->modified || 2896 2896 (ctrl->info.flags & UVC_CTRL_FLAG_RESTORE) == 0) 2897 2897 continue; 2898 - dev_dbg(&dev->udev->dev, 2898 + dev_dbg(&dev->intf->dev, 2899 2899 "restoring control %pUl/%u/%u\n", 2900 2900 ctrl->info.entity, ctrl->info.index, 2901 2901 ctrl->info.selector);
+10 -10
drivers/media/usb/uvc/uvc_driver.c
··· 1864 1864 uvc_scan_fallback(dev); 1865 1865 1866 1866 if (list_empty(&dev->chains)) { 1867 - dev_info(&dev->udev->dev, "No valid video chain found.\n"); 1867 + dev_info(&dev->intf->dev, "No valid video chain found.\n"); 1868 1868 return -ENODEV; 1869 1869 } 1870 1870 ··· 2088 2088 2089 2089 stream = uvc_stream_by_id(dev, term->id); 2090 2090 if (stream == NULL) { 2091 - dev_info(&dev->udev->dev, 2091 + dev_info(&dev->intf->dev, 2092 2092 "No streaming interface found for terminal %u.", 2093 2093 term->id); 2094 2094 continue; ··· 2124 2124 #ifdef CONFIG_MEDIA_CONTROLLER 2125 2125 ret = uvc_mc_register_entities(chain); 2126 2126 if (ret < 0) 2127 - dev_info(&dev->udev->dev, 2127 + dev_info(&dev->intf->dev, 2128 2128 "Failed to register entities (%d).\n", ret); 2129 2129 #endif 2130 2130 } ··· 2225 2225 if (ret < 0) 2226 2226 goto error; 2227 2227 2228 - dev_info(&dev->udev->dev, "Found UVC %u.%02x device %s (%04x:%04x)\n", 2228 + dev_info(&dev->intf->dev, "Found UVC %u.%02x device %s (%04x:%04x)\n", 2229 2229 dev->uvc_version >> 8, dev->uvc_version & 0xff, 2230 2230 udev->product ? udev->product : "<unnamed>", 2231 2231 le16_to_cpu(udev->descriptor.idVendor), 2232 2232 le16_to_cpu(udev->descriptor.idProduct)); 2233 2233 2234 2234 if (dev->quirks != dev->info->quirks) { 2235 - dev_info(&dev->udev->dev, 2235 + dev_info(&dev->intf->dev, 2236 2236 "Forcing device quirks to 0x%x by module parameter for testing purpose.\n", 2237 2237 dev->quirks); 2238 - dev_info(&dev->udev->dev, 2238 + dev_info(&dev->intf->dev, 2239 2239 "Please report required quirks to the linux-media mailing list.\n"); 2240 2240 } 2241 2241 2242 2242 if (dev->info->uvc_version) { 2243 2243 dev->uvc_version = dev->info->uvc_version; 2244 - dev_info(&dev->udev->dev, "Forcing UVC version to %u.%02x\n", 2244 + dev_info(&dev->intf->dev, "Forcing UVC version to %u.%02x\n", 2245 2245 dev->uvc_version >> 8, dev->uvc_version & 0xff); 2246 2246 } 2247 2247 ··· 2277 2277 /* Initialize the interrupt URB. */ 2278 2278 ret = uvc_status_init(dev); 2279 2279 if (ret < 0) { 2280 - dev_info(&dev->udev->dev, 2280 + dev_info(&dev->intf->dev, 2281 2281 "Unable to initialize the status endpoint (%d), status interrupt will not be supported.\n", 2282 2282 ret); 2283 2283 } 2284 2284 2285 2285 ret = uvc_gpio_init_irq(dev); 2286 2286 if (ret < 0) { 2287 - dev_err(&dev->udev->dev, 2287 + dev_err(&dev->intf->dev, 2288 2288 "Unable to request privacy GPIO IRQ (%d)\n", ret); 2289 2289 goto error; 2290 2290 } 2291 2291 2292 2292 ret = uvc_meta_init(dev); 2293 2293 if (ret < 0) { 2294 - dev_err(&dev->udev->dev, 2294 + dev_err(&dev->intf->dev, 2295 2295 "Error initializing the metadata formats (%d)\n", ret); 2296 2296 goto error; 2297 2297 }
+2 -2
drivers/media/usb/uvc/uvc_entity.c
··· 140 140 list_for_each_entry(entity, &chain->entities, chain) { 141 141 ret = uvc_mc_init_entity(chain, entity); 142 142 if (ret < 0) { 143 - dev_info(&chain->dev->udev->dev, 143 + dev_info(&chain->dev->intf->dev, 144 144 "Failed to initialize entity for entity %u\n", 145 145 entity->id); 146 146 return ret; ··· 150 150 list_for_each_entry(entity, &chain->entities, chain) { 151 151 ret = uvc_mc_create_links(chain, entity); 152 152 if (ret < 0) { 153 - dev_info(&chain->dev->udev->dev, 153 + dev_info(&chain->dev->intf->dev, 154 154 "Failed to create links for entity %u\n", 155 155 entity->id); 156 156 return ret;
+2 -2
drivers/media/usb/uvc/uvc_status.c
··· 216 216 return; 217 217 218 218 default: 219 - dev_warn(&dev->udev->dev, 219 + dev_warn(&dev->intf->dev, 220 220 "Non-zero status (%d) in status completion handler.\n", 221 221 urb->status); 222 222 return; ··· 248 248 urb->interval = dev->int_ep->desc.bInterval; 249 249 ret = usb_submit_urb(urb, GFP_ATOMIC); 250 250 if (ret < 0) 251 - dev_err(&dev->udev->dev, 251 + dev_err(&dev->intf->dev, 252 252 "Failed to resubmit status URB (%d).\n", ret); 253 253 } 254 254
+3 -3
drivers/media/usb/uvc/uvc_video.c
··· 95 95 */ 96 96 if (ret > 0 && query != UVC_GET_INFO) { 97 97 memset(data + ret, 0, size - ret); 98 - dev_warn_once(&dev->udev->dev, 98 + dev_warn_once(&dev->intf->dev, 99 99 "UVC non compliance: %s control %u on unit %u returned %d bytes when we expected %u.\n", 100 100 uvc_query_name(query), cs, unit, ret, size); 101 101 return 0; 102 102 } 103 103 104 104 if (ret != -EPIPE) { 105 - dev_err(&dev->udev->dev, 105 + dev_err(&dev->intf->dev, 106 106 "Failed to query (%s) UVC control %u on unit %u: %d (exp. %u).\n", 107 107 uvc_query_name(query), cs, unit, ret, size); 108 108 return ret < 0 ? ret : -EPIPE; ··· 119 119 *(u8 *)data = tmp; 120 120 121 121 if (ret != 1) { 122 - dev_err_ratelimited(&dev->udev->dev, 122 + dev_err_ratelimited(&dev->intf->dev, 123 123 "Failed to query (%s) UVC error code control %u on unit %u: %d (exp. 1).\n", 124 124 uvc_query_name(query), cs, unit, ret); 125 125 return ret < 0 ? ret : -EPIPE;
+2 -2
drivers/media/usb/uvc/uvcvideo.h
··· 665 665 #define uvc_dbg(_dev, flag, fmt, ...) \ 666 666 do { \ 667 667 if (uvc_dbg_param & UVC_DBG_##flag) \ 668 - dev_printk(KERN_DEBUG, &(_dev)->udev->dev, fmt, \ 668 + dev_printk(KERN_DEBUG, &(_dev)->intf->dev, fmt, \ 669 669 ##__VA_ARGS__); \ 670 670 } while (0) 671 671 ··· 678 678 #define uvc_warn_once(_dev, warn, fmt, ...) \ 679 679 do { \ 680 680 if (!test_and_set_bit(warn, &(_dev)->warnings)) \ 681 - dev_info(&(_dev)->udev->dev, fmt, ##__VA_ARGS__); \ 681 + dev_info(&(_dev)->intf->dev, fmt, ##__VA_ARGS__); \ 682 682 } while (0) 683 683 684 684 /* --------------------------------------------------------------------------