Skip to content

Commit a212d6a

Browse files
wambu-idanvet
authored andcommitted
drm/debugfs: remove checks for return value of drm_debugfs functions.
Since 987d65d (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
1 parent 092c367 commit a212d6a

2 files changed

Lines changed: 14 additions & 35 deletions

File tree

‎drivers/gpu/drm/drm_debugfs.c‎

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ static const struct file_operations drm_debugfs_fops = {
172172
* &struct drm_info_list in the given root directory. These files will be removed
173173
* automatically on drm_debugfs_cleanup().
174174
*/
175-
int drm_debugfs_create_files(const struct drm_info_list *files, int count,
176-
struct dentry *root, struct drm_minor *minor)
175+
void drm_debugfs_create_files(const struct drm_info_list *files, int count,
176+
struct dentry *root, struct drm_minor *minor)
177177
{
178178
struct drm_device *dev = minor->dev;
179179
struct drm_info_node *tmp;
@@ -199,7 +199,6 @@ int drm_debugfs_create_files(const struct drm_info_list *files, int count,
199199
list_add(&tmp->list, &minor->debugfs_list);
200200
mutex_unlock(&minor->debugfs_lock);
201201
}
202-
return 0;
203202
}
204203
EXPORT_SYMBOL(drm_debugfs_create_files);
205204

@@ -215,35 +214,17 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
215214
sprintf(name, "%d", minor_id);
216215
minor->debugfs_root = debugfs_create_dir(name, root);
217216

218-
ret = drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
219-
minor->debugfs_root, minor);
220-
if (ret) {
221-
debugfs_remove(minor->debugfs_root);
222-
minor->debugfs_root = NULL;
223-
DRM_ERROR("Failed to create core drm debugfs files\n");
224-
return ret;
225-
}
217+
drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
218+
minor->debugfs_root, minor);
226219

227220
if (drm_drv_uses_atomic_modeset(dev)) {
228-
ret = drm_atomic_debugfs_init(minor);
229-
if (ret) {
230-
DRM_ERROR("Failed to create atomic debugfs files\n");
231-
return ret;
232-
}
221+
drm_atomic_debugfs_init(minor);
233222
}
234223

235224
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
236-
ret = drm_framebuffer_debugfs_init(minor);
237-
if (ret) {
238-
DRM_ERROR("Failed to create framebuffer debugfs file\n");
239-
return ret;
240-
}
225+
drm_framebuffer_debugfs_init(minor);
241226

242-
ret = drm_client_debugfs_init(minor);
243-
if (ret) {
244-
DRM_ERROR("Failed to create client debugfs file\n");
245-
return ret;
246-
}
227+
drm_client_debugfs_init(minor);
247228
}
248229

249230
if (dev->driver->debugfs_init) {

‎include/drm/drm_debugfs.h‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,16 @@ struct drm_info_node {
8080
};
8181

8282
#if defined(CONFIG_DEBUG_FS)
83-
int drm_debugfs_create_files(const struct drm_info_list *files,
84-
int count, struct dentry *root,
85-
struct drm_minor *minor);
83+
void drm_debugfs_create_files(const struct drm_info_list *files,
84+
int count, struct dentry *root,
85+
struct drm_minor *minor);
8686
int drm_debugfs_remove_files(const struct drm_info_list *files,
8787
int count, struct drm_minor *minor);
8888
#else
89-
static inline int drm_debugfs_create_files(const struct drm_info_list *files,
90-
int count, struct dentry *root,
91-
struct drm_minor *minor)
92-
{
93-
return 0;
94-
}
89+
static inline void drm_debugfs_create_files(const struct drm_info_list *files,
90+
int count, struct dentry *root,
91+
struct drm_minor *minor)
92+
{}
9593

9694
static inline int drm_debugfs_remove_files(const struct drm_info_list *files,
9795
int count, struct drm_minor *minor)

0 commit comments

Comments
 (0)