]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
media: usb: uvc: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Aug 2020 13:36:08 +0000 (15:36 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 26 Sep 2020 08:15:17 +0000 (10:15 +0200)
When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/uvc/uvc_debugfs.c

index 2b8af4b541174ee1eba382b2dde227766b2e15ac..1a1258d4ffcadf8a932b783013c3ec45ebd40f8e 100644 (file)
@@ -73,7 +73,6 @@ static struct dentry *uvc_debugfs_root_dir;
 void uvc_debugfs_init_stream(struct uvc_streaming *stream)
 {
        struct usb_device *udev = stream->dev->udev;
-       struct dentry *dent;
        char dir_name[33];
 
        if (uvc_debugfs_root_dir == NULL)
@@ -82,22 +81,11 @@ void uvc_debugfs_init_stream(struct uvc_streaming *stream)
        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)) {
-               uvc_printk(KERN_INFO, "Unable to create debugfs %s "
-                          "directory.\n", dir_name);
-               return;
-       }
-
-       stream->debugfs_dir = dent;
+       stream->debugfs_dir = debugfs_create_dir(dir_name,
+                                                uvc_debugfs_root_dir);
 
-       dent = debugfs_create_file("stats", 0444, stream->debugfs_dir,
-                                  stream, &uvc_debugfs_stats_fops);
-       if (IS_ERR_OR_NULL(dent)) {
-               uvc_printk(KERN_INFO, "Unable to create debugfs stats file.\n");
-               uvc_debugfs_cleanup_stream(stream);
-               return;
-       }
+       debugfs_create_file("stats", 0444, stream->debugfs_dir, stream,
+                           &uvc_debugfs_stats_fops);
 }
 
 void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream)