On 24/04/18(Tue) 17:15, Landry Breuil wrote: > On Tue, Apr 24, 2018 at 04:04:34PM +0100, Stuart Henderson wrote: > > On 2018/04/24 16:34, Landry Breuil wrote: > > > Hi, > > > > > > here's a diff to reuse usbd_devinfo_vp() (exposed in usbdivar.h) in > > > VIDIOC_QUERYCAP ioctl callback, this way we can fill v4l2_capability > > > card struct member with the actual usb product name instead of a dummy > > > "Generic USB video class device". > > > > Generally I think this is a good idea, but some devices have crap in > > v/p, is that likely to cause any problems? > > Well, the exact same function is called in usbd_devinfo() during boot to > generate the dmesg lines for the devices.. so i dont really see how it makes > things worse.
And by usbdevs(8) and the libusb. I'm ok with the diff if you change the last argument to be 0. Setting `usedev' to 1 makes the function generate I/O. We want to avoid that as much as possible. I would be very happy if you could reduce the number of calls to usbd_devinfo_vp() in the stack and used the cached the result instead.