media: uvcvideo: Factor out usb_string() calls
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 25 Oct 2022 18:42:21 +0000 (21:42 +0300)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 15 Jan 2023 21:45:11 +0000 (23:45 +0200)
commit5f0e659d2a2ac6172d495915f2775fa592c7ab17
treeb15ef987d0d8b0473e87fdf3505044f1f3b7e3fe
parent81e78a6fc320693c269990fb1af37b8c2c382cf2
media: uvcvideo: Factor out usb_string() calls

When parsing UVC descriptors to instantiate entities, the driver calls
usb_string() to retrieve the entity name from the device, and falls back
to a default name if the string can't be retrieved. This code pattern
occurs multiple times. Factor it out to a separate helper function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
drivers/media/usb/uvc/uvc_driver.c