summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/uvc
diff options
context:
space:
mode:
authorTorleiv Sundre2019-04-28 07:21:13 +0200
committerMauro Carvalho Chehab2019-06-11 18:21:58 +0200
commit675e2f20b1139633876cdc8f621065fcbd582be9 (patch)
tree919eac1e526615c60d62eed9fd0dc7e1c8fbfa60 /drivers/media/usb/uvc
parentMerge tag 'v5.2-rc4' into media/master (diff)
downloadkernel-qcow2-linux-675e2f20b1139633876cdc8f621065fcbd582be9.tar.gz
kernel-qcow2-linux-675e2f20b1139633876cdc8f621065fcbd582be9.tar.xz
kernel-qcow2-linux-675e2f20b1139633876cdc8f621065fcbd582be9.zip
media: uvcvideo: Include streaming interface number in debugfs dir name
uvcvideo creates a debugfs directory based on the device bus number and device number. If a device contains more than one uvc function, the creation of the second and following debugfs directories will fail and print an info message like this: "uvcvideo: Unable to create debugfs 3-2 directory." This patch includes the uvc streaming interface number in the debugfs directory name, to make sure it is unique. The directory name format is changed from "<busnum>-<devnum>" to "<busnum>-<devnum>-<intfnum>" Signed-off-by: Torleiv Sundre <torleiv@huddly.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/usb/uvc')
-rw-r--r--drivers/media/usb/uvc/uvc_debugfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/usb/uvc/uvc_debugfs.c b/drivers/media/usb/uvc/uvc_debugfs.c
index 8ba54139a087..d2b109959d82 100644
--- a/drivers/media/usb/uvc/uvc_debugfs.c
+++ b/drivers/media/usb/uvc/uvc_debugfs.c
@@ -74,12 +74,13 @@ void uvc_debugfs_init_stream(struct uvc_streaming *stream)
{
struct usb_device *udev = stream->dev->udev;
struct dentry *dent;
- char dir_name[32];
+ char dir_name[33];
if (uvc_debugfs_root_dir == NULL)
return;
- sprintf(dir_name, "%u-%u", udev->bus->busnum, udev->devnum);
+ snprintf(dir_name, sizeof(dir_name), "%u-%u-%u", udev->bus->busnum,
+ udev->devnum, stream->intfnum);
dent = debugfs_create_dir(dir_name, uvc_debugfs_root_dir);
if (IS_ERR_OR_NULL(dent)) {