mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-23 23:50:51 +07:00
drm/debugfs: remove checks for return value of drm_debugfs functions.
Since 987d65d013
(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
This commit is contained in:
parent
092c367ac6
commit
a212d6a557
@ -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) {
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user