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 <torl...@huddly.com>
---
 drivers/media/usb/uvc/uvc_debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_debugfs.c 
b/drivers/media/usb/uvc/uvc_debugfs.c
index 77e7c2419b9b..6e244acb80ab 100644
--- a/drivers/media/usb/uvc/uvc_debugfs.c
+++ b/drivers/media/usb/uvc/uvc_debugfs.c
@@ -84,7 +84,8 @@ void uvc_debugfs_init_stream(struct uvc_streaming *stream)
        if (uvc_debugfs_root_dir == NULL)
                return;
 
-       sprintf(dir_name, "%u-%u", udev->bus->busnum, udev->devnum);
+       sprintf(dir_name, "%u-%u-%d", udev->bus->busnum, udev->devnum,
+               stream->intfnum);
 
        dent = debugfs_create_dir(dir_name, uvc_debugfs_root_dir);
        if (IS_ERR_OR_NULL(dent)) {
-- 
2.19.1

Reply via email to