@@ -272,9 +272,6 @@ static void drm_debugfs_remove_all_files(struct drm_minor *minor)
void drm_debugfs_cleanup(struct drm_minor *minor)
{
- if (!minor->debugfs_root)
- return;
-
drm_debugfs_remove_all_files(minor);
debugfs_remove_recursive(minor->debugfs_root);
@@ -419,9 +416,6 @@ void drm_debugfs_connector_add(struct drm_connector *connector)
struct drm_minor *minor = connector->dev->primary;
struct dentry *root;
- if (!minor->debugfs_root)
- return;
-
root = debugfs_create_dir(connector->name, minor->debugfs_root);
connector->debugfs_entry = root;
@@ -440,9 +434,6 @@ void drm_debugfs_connector_add(struct drm_connector *connector)
void drm_debugfs_connector_remove(struct drm_connector *connector)
{
- if (!connector->debugfs_entry)
- return;
-
debugfs_remove_recursive(connector->debugfs_entry);
connector->debugfs_entry = NULL;
Debugfs APIs returns encoded error on failure instead of NULL and for drm primary/minor debugfs directories, we save the returned value in the dentry pointer and pass it on to drm drivers to further create debugfs files/directories. Error conditions are handled by debugfs APIs, so no need to check for NULL, as saved dentry pointers will either contain a valid pointer or an error code. CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> CC: Maxime Ripard <mripard@kernel.org> CC: Thomas Zimmermann <tzimmermann@suse.de> CC: David Airlie <airlied@linux.ie> CC: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com> --- drivers/gpu/drm/drm_debugfs.c | 9 --------- 1 file changed, 9 deletions(-) -- 2.32.0