Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 675e2f20 authored by Torleiv Sundre's avatar Torleiv Sundre Committed by Mauro Carvalho Chehab
Browse files

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: default avatarTorleiv Sundre <torleiv@huddly.com>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 58005719
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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)) {