drm/nouveau: remove checks for return value of debugfs functions
authorWambui Karuga <wambui.karugax@gmail.com>
Tue, 18 Feb 2020 17:28:17 +0000 (20:28 +0300)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 7 Apr 2020 04:37:49 +0000 (14:37 +1000)
As there is no need to check for the return value of debugfs_create_file
and drm_debugfs_create_files, remove unnecessary checks and error
handling in nouveau_drm_debugfs_init.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_debugfs.c

index 7dfbbbc1beea6ad1f5fa10cd535bffa130badebe..15a3d40edf0292ca16797a482b0b16d73573ff21 100644 (file)
@@ -222,22 +222,18 @@ nouveau_drm_debugfs_init(struct drm_minor *minor)
 {
        struct nouveau_drm *drm = nouveau_drm(minor->dev);
        struct dentry *dentry;
-       int i, ret;
+       int i;
 
        for (i = 0; i < ARRAY_SIZE(nouveau_debugfs_files); i++) {
-               dentry = debugfs_create_file(nouveau_debugfs_files[i].name,
-                                            S_IRUGO | S_IWUSR,
-                                            minor->debugfs_root, minor->dev,
-                                            nouveau_debugfs_files[i].fops);
-               if (!dentry)
-                       return -ENOMEM;
+               debugfs_create_file(nouveau_debugfs_files[i].name,
+                                   S_IRUGO | S_IWUSR,
+                                   minor->debugfs_root, minor->dev,
+                                   nouveau_debugfs_files[i].fops);
        }
 
-       ret = drm_debugfs_create_files(nouveau_debugfs_list,
-                                      NOUVEAU_DEBUGFS_ENTRIES,
-                                      minor->debugfs_root, minor);
-       if (ret)
-               return ret;
+       drm_debugfs_create_files(nouveau_debugfs_list,
+                                NOUVEAU_DEBUGFS_ENTRIES,
+                                minor->debugfs_root, minor);
 
        /* Set the size of the vbios since we know it, and it's confusing to
         * userspace if it wants to seek() but the file has a length of 0