Commit 81895b54 authored by Noralf Trønnes's avatar Noralf Trønnes Committed by Daniel Vetter

drm/msm: Remove drm_debugfs_remove_files() calls

drm_debugfs_cleanup() now removes all minor->debugfs_list entries
automatically, so it's not necessary to call
drm_debugfs_remove_files(). Additionally it uses
debugfs_remove_recursive() to clean up the debugfs files, so no need
to do that.

Cc: robdclark@gmail.com
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170126225621.12314-10-noralf@tronnes.org
parent b05eeb0f
...@@ -214,12 +214,6 @@ static int mdp5_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor) ...@@ -214,12 +214,6 @@ static int mdp5_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
return 0; return 0;
} }
static void mdp5_kms_debugfs_cleanup(struct msm_kms *kms, struct drm_minor *minor)
{
drm_debugfs_remove_files(mdp5_debugfs_list,
ARRAY_SIZE(mdp5_debugfs_list), minor);
}
#endif #endif
static const struct mdp_kms_funcs kms_funcs = { static const struct mdp_kms_funcs kms_funcs = {
...@@ -242,7 +236,6 @@ static const struct mdp_kms_funcs kms_funcs = { ...@@ -242,7 +236,6 @@ static const struct mdp_kms_funcs kms_funcs = {
.destroy = mdp5_kms_destroy, .destroy = mdp5_kms_destroy,
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
.debugfs_init = mdp5_kms_debugfs_init, .debugfs_init = mdp5_kms_debugfs_init,
.debugfs_cleanup = mdp5_kms_debugfs_cleanup,
#endif #endif
}, },
.set_irqmask = mdp5_set_irqmask, .set_irqmask = mdp5_set_irqmask,
......
...@@ -170,8 +170,6 @@ void msm_debugfs_cleanup(struct drm_minor *minor) ...@@ -170,8 +170,6 @@ void msm_debugfs_cleanup(struct drm_minor *minor)
struct drm_device *dev = minor->dev; struct drm_device *dev = minor->dev;
struct msm_drm_private *priv = dev->dev_private; struct msm_drm_private *priv = dev->dev_private;
drm_debugfs_remove_files(msm_debugfs_list,
ARRAY_SIZE(msm_debugfs_list), minor);
if (!priv) if (!priv)
return; return;
......
...@@ -41,9 +41,6 @@ struct msm_perf_state { ...@@ -41,9 +41,6 @@ struct msm_perf_state {
int buftot, bufpos; int buftot, bufpos;
unsigned long next_jiffies; unsigned long next_jiffies;
struct dentry *ent;
struct drm_info_node *node;
}; };
#define SAMPLE_TIME (HZ/4) #define SAMPLE_TIME (HZ/4)
...@@ -208,6 +205,7 @@ int msm_perf_debugfs_init(struct drm_minor *minor) ...@@ -208,6 +205,7 @@ int msm_perf_debugfs_init(struct drm_minor *minor)
{ {
struct msm_drm_private *priv = minor->dev->dev_private; struct msm_drm_private *priv = minor->dev->dev_private;
struct msm_perf_state *perf; struct msm_perf_state *perf;
struct dentry *ent;
/* only create on first minor: */ /* only create on first minor: */
if (priv->perf) if (priv->perf)
...@@ -222,26 +220,14 @@ int msm_perf_debugfs_init(struct drm_minor *minor) ...@@ -222,26 +220,14 @@ int msm_perf_debugfs_init(struct drm_minor *minor)
mutex_init(&perf->read_lock); mutex_init(&perf->read_lock);
priv->perf = perf; priv->perf = perf;
perf->node = kzalloc(sizeof(*perf->node), GFP_KERNEL); ent = debugfs_create_file("perf", S_IFREG | S_IRUGO,
if (!perf->node)
goto fail;
perf->ent = debugfs_create_file("perf", S_IFREG | S_IRUGO,
minor->debugfs_root, perf, &perf_debugfs_fops); minor->debugfs_root, perf, &perf_debugfs_fops);
if (!perf->ent) { if (!ent) {
DRM_ERROR("Cannot create /sys/kernel/debug/dri/%pd/perf\n", DRM_ERROR("Cannot create /sys/kernel/debug/dri/%pd/perf\n",
minor->debugfs_root); minor->debugfs_root);
goto fail; goto fail;
} }
perf->node->minor = minor;
perf->node->dent = perf->ent;
perf->node->info_ent = NULL;
mutex_lock(&minor->debugfs_lock);
list_add(&perf->node->list, &minor->debugfs_list);
mutex_unlock(&minor->debugfs_lock);
return 0; return 0;
fail: fail:
...@@ -259,15 +245,6 @@ void msm_perf_debugfs_cleanup(struct drm_minor *minor) ...@@ -259,15 +245,6 @@ void msm_perf_debugfs_cleanup(struct drm_minor *minor)
priv->perf = NULL; priv->perf = NULL;
debugfs_remove(perf->ent);
if (perf->node) {
mutex_lock(&minor->debugfs_lock);
list_del(&perf->node->list);
mutex_unlock(&minor->debugfs_lock);
kfree(perf->node);
}
mutex_destroy(&perf->read_lock); mutex_destroy(&perf->read_lock);
kfree(perf); kfree(perf);
......
...@@ -84,9 +84,6 @@ struct msm_rd_state { ...@@ -84,9 +84,6 @@ struct msm_rd_state {
bool open; bool open;
struct dentry *ent;
struct drm_info_node *node;
/* current submit to read out: */ /* current submit to read out: */
struct msm_gem_submit *submit; struct msm_gem_submit *submit;
...@@ -219,6 +216,7 @@ int msm_rd_debugfs_init(struct drm_minor *minor) ...@@ -219,6 +216,7 @@ int msm_rd_debugfs_init(struct drm_minor *minor)
{ {
struct msm_drm_private *priv = minor->dev->dev_private; struct msm_drm_private *priv = minor->dev->dev_private;
struct msm_rd_state *rd; struct msm_rd_state *rd;
struct dentry *ent;
/* only create on first minor: */ /* only create on first minor: */
if (priv->rd) if (priv->rd)
...@@ -236,26 +234,14 @@ int msm_rd_debugfs_init(struct drm_minor *minor) ...@@ -236,26 +234,14 @@ int msm_rd_debugfs_init(struct drm_minor *minor)
init_waitqueue_head(&rd->fifo_event); init_waitqueue_head(&rd->fifo_event);
rd->node = kzalloc(sizeof(*rd->node), GFP_KERNEL); ent = debugfs_create_file("rd", S_IFREG | S_IRUGO,
if (!rd->node)
goto fail;
rd->ent = debugfs_create_file("rd", S_IFREG | S_IRUGO,
minor->debugfs_root, rd, &rd_debugfs_fops); minor->debugfs_root, rd, &rd_debugfs_fops);
if (!rd->ent) { if (!ent) {
DRM_ERROR("Cannot create /sys/kernel/debug/dri/%pd/rd\n", DRM_ERROR("Cannot create /sys/kernel/debug/dri/%pd/rd\n",
minor->debugfs_root); minor->debugfs_root);
goto fail; goto fail;
} }
rd->node->minor = minor;
rd->node->dent = rd->ent;
rd->node->info_ent = NULL;
mutex_lock(&minor->debugfs_lock);
list_add(&rd->node->list, &minor->debugfs_list);
mutex_unlock(&minor->debugfs_lock);
return 0; return 0;
fail: fail:
...@@ -272,18 +258,7 @@ void msm_rd_debugfs_cleanup(struct drm_minor *minor) ...@@ -272,18 +258,7 @@ void msm_rd_debugfs_cleanup(struct drm_minor *minor)
return; return;
priv->rd = NULL; priv->rd = NULL;
debugfs_remove(rd->ent);
if (rd->node) {
mutex_lock(&minor->debugfs_lock);
list_del(&rd->node->list);
mutex_unlock(&minor->debugfs_lock);
kfree(rd->node);
}
mutex_destroy(&rd->read_lock); mutex_destroy(&rd->read_lock);
kfree(rd); kfree(rd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment