drm/debugfs: remove checks for return value of drm_debugfs functions.
authorWambui Karuga <wambui.karugax@gmail.com>
Tue, 10 Mar 2020 13:31:20 +0000 (16:31 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 18 Mar 2020 16:32:20 +0000 (17:32 +0100)
Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never
fail), there is no need to check the return value of
drm_debugfs_create_files(). Therefore, remove remove unnecessary checks
and error handling statement blocks for its return value.

These changes also enable changing drm_debugfs_create_files() to return
void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-17-wambui.karugax@gmail.com
drivers/gpu/drm/drm_debugfs.c
include/drm/drm_debugfs.h

index 4e673d3..e13f216 100644 (file)
@@ -172,8 +172,8 @@ static const struct file_operations drm_debugfs_fops = {
  * &struct drm_info_list in the given root directory. These files will be removed
  * automatically on drm_debugfs_cleanup().
  */
-int drm_debugfs_create_files(const struct drm_info_list *files, int count,
-                            struct dentry *root, struct drm_minor *minor)
+void drm_debugfs_create_files(const struct drm_info_list *files, int count,
+                             struct dentry *root, struct drm_minor *minor)
 {
        struct drm_device *dev = minor->dev;
        struct drm_info_node *tmp;
@@ -199,7 +199,6 @@ int drm_debugfs_create_files(const struct drm_info_list *files, int count,
                list_add(&tmp->list, &minor->debugfs_list);
                mutex_unlock(&minor->debugfs_lock);
        }
-       return 0;
 }
 EXPORT_SYMBOL(drm_debugfs_create_files);
 
@@ -215,35 +214,17 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
        sprintf(name, "%d", minor_id);
        minor->debugfs_root = debugfs_create_dir(name, root);
 
-       ret = drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
-                                      minor->debugfs_root, minor);
-       if (ret) {
-               debugfs_remove(minor->debugfs_root);
-               minor->debugfs_root = NULL;
-               DRM_ERROR("Failed to create core drm debugfs files\n");
-               return ret;
-       }
+       drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
+                                minor->debugfs_root, minor);
 
        if (drm_drv_uses_atomic_modeset(dev)) {
-               ret = drm_atomic_debugfs_init(minor);
-               if (ret) {
-                       DRM_ERROR("Failed to create atomic debugfs files\n");
-                       return ret;
-               }
+               drm_atomic_debugfs_init(minor);
        }
 
        if (drm_core_check_feature(dev, DRIVER_MODESET)) {
-               ret = drm_framebuffer_debugfs_init(minor);
-               if (ret) {
-                       DRM_ERROR("Failed to create framebuffer debugfs file\n");
-                       return ret;
-               }
+               drm_framebuffer_debugfs_init(minor);
 
-               ret = drm_client_debugfs_init(minor);
-               if (ret) {
-                       DRM_ERROR("Failed to create client debugfs file\n");
-                       return ret;
-               }
+               drm_client_debugfs_init(minor);
        }
 
        if (dev->driver->debugfs_init) {
index 7501e32..2188dc8 100644 (file)
@@ -80,18 +80,16 @@ struct drm_info_node {
 };
 
 #if defined(CONFIG_DEBUG_FS)
-int drm_debugfs_create_files(const struct drm_info_list *files,
-                            int count, struct dentry *root,
-                            struct drm_minor *minor);
+void drm_debugfs_create_files(const struct drm_info_list *files,
+                             int count, struct dentry *root,
+                             struct drm_minor *minor);
 int drm_debugfs_remove_files(const struct drm_info_list *files,
                             int count, struct drm_minor *minor);
 #else
-static inline int drm_debugfs_create_files(const struct drm_info_list *files,
-                                          int count, struct dentry *root,
-                                          struct drm_minor *minor)
-{
-       return 0;
-}
+static inline void drm_debugfs_create_files(const struct drm_info_list *files,
+                                           int count, struct dentry *root,
+                                           struct drm_minor *minor)
+{}
 
 static inline int drm_debugfs_remove_files(const struct drm_info_list *files,
                                           int count, struct drm_minor *minor)