From patchwork Thu Jan 26 22:56:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 9540259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB79F60429 for ; Thu, 26 Jan 2017 22:56:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C20B120649 for ; Thu, 26 Jan 2017 22:56:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B66A92807B; Thu, 26 Jan 2017 22:56:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 55C3F20649 for ; Thu, 26 Jan 2017 22:56:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 381FC6EC79; Thu, 26 Jan 2017 22:56:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8FFF86EC6F for ; Thu, 26 Jan 2017 22:56:44 +0000 (UTC) Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:33677 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cWsyA-0004r8-GO; Thu, 26 Jan 2017 23:56:42 +0100 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 09/19] drm/msm: Remove drm_debugfs_remove_files() calls Date: Thu, 26 Jan 2017 23:56:11 +0100 Message-Id: <20170126225621.12314-10-noralf@tronnes.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170126225621.12314-1-noralf@tronnes.org> References: <20170126225621.12314-1-noralf@tronnes.org> MIME-Version: 1.0 Cc: kraxel@redhat.com, liviu.dudau@arm.com, linux@armlinux.org.uk, jsarha@ti.com, tomi.valkeinen@ti.com, bskeggs@redhat.com, linux+etnaviv@armlinux.org.uk, alexander.deucher@amd.com, daniel.vetter@intel.com, vincent.abriou@st.com, christian.koenig@amd.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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: Noralf Trønnes --- drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 7 ------- drivers/gpu/drm/msm/msm_debugfs.c | 2 -- drivers/gpu/drm/msm/msm_perf.c | 29 +++-------------------------- drivers/gpu/drm/msm/msm_rd.c | 31 +++---------------------------- 4 files changed, 6 insertions(+), 63 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c index 5f6cd87..2f21a18 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c @@ -212,12 +212,6 @@ static int mdp5_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor) 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 static const struct mdp_kms_funcs kms_funcs = { @@ -239,7 +233,6 @@ static const struct mdp_kms_funcs kms_funcs = { .destroy = mdp5_kms_destroy, #ifdef CONFIG_DEBUG_FS .debugfs_init = mdp5_kms_debugfs_init, - .debugfs_cleanup = mdp5_kms_debugfs_cleanup, #endif }, .set_irqmask = mdp5_set_irqmask, diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c index 387f0616..75609a1 100644 --- a/drivers/gpu/drm/msm/msm_debugfs.c +++ b/drivers/gpu/drm/msm/msm_debugfs.c @@ -170,8 +170,6 @@ void msm_debugfs_cleanup(struct drm_minor *minor) struct drm_device *dev = minor->dev; struct msm_drm_private *priv = dev->dev_private; - drm_debugfs_remove_files(msm_debugfs_list, - ARRAY_SIZE(msm_debugfs_list), minor); if (!priv) return; diff --git a/drivers/gpu/drm/msm/msm_perf.c b/drivers/gpu/drm/msm/msm_perf.c index 1627294..fc5a948 100644 --- a/drivers/gpu/drm/msm/msm_perf.c +++ b/drivers/gpu/drm/msm/msm_perf.c @@ -41,9 +41,6 @@ struct msm_perf_state { int buftot, bufpos; unsigned long next_jiffies; - - struct dentry *ent; - struct drm_info_node *node; }; #define SAMPLE_TIME (HZ/4) @@ -208,6 +205,7 @@ int msm_perf_debugfs_init(struct drm_minor *minor) { struct msm_drm_private *priv = minor->dev->dev_private; struct msm_perf_state *perf; + struct dentry *ent; /* only create on first minor: */ if (priv->perf) @@ -222,26 +220,14 @@ int msm_perf_debugfs_init(struct drm_minor *minor) mutex_init(&perf->read_lock); priv->perf = perf; - perf->node = kzalloc(sizeof(*perf->node), GFP_KERNEL); - if (!perf->node) - goto fail; - - perf->ent = debugfs_create_file("perf", S_IFREG | S_IRUGO, + ent = debugfs_create_file("perf", S_IFREG | S_IRUGO, minor->debugfs_root, perf, &perf_debugfs_fops); - if (!perf->ent) { + if (!ent) { DRM_ERROR("Cannot create /sys/kernel/debug/dri/%pd/perf\n", minor->debugfs_root); 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; fail: @@ -259,15 +245,6 @@ void msm_perf_debugfs_cleanup(struct drm_minor *minor) 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); kfree(perf); diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c index 6607456..ab0b39f 100644 --- a/drivers/gpu/drm/msm/msm_rd.c +++ b/drivers/gpu/drm/msm/msm_rd.c @@ -84,9 +84,6 @@ struct msm_rd_state { bool open; - struct dentry *ent; - struct drm_info_node *node; - /* current submit to read out: */ struct msm_gem_submit *submit; @@ -219,6 +216,7 @@ int msm_rd_debugfs_init(struct drm_minor *minor) { struct msm_drm_private *priv = minor->dev->dev_private; struct msm_rd_state *rd; + struct dentry *ent; /* only create on first minor: */ if (priv->rd) @@ -236,26 +234,14 @@ int msm_rd_debugfs_init(struct drm_minor *minor) init_waitqueue_head(&rd->fifo_event); - rd->node = kzalloc(sizeof(*rd->node), GFP_KERNEL); - if (!rd->node) - goto fail; - - rd->ent = debugfs_create_file("rd", S_IFREG | S_IRUGO, + ent = debugfs_create_file("rd", S_IFREG | S_IRUGO, minor->debugfs_root, rd, &rd_debugfs_fops); - if (!rd->ent) { + if (!ent) { DRM_ERROR("Cannot create /sys/kernel/debug/dri/%pd/rd\n", minor->debugfs_root); 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; fail: @@ -272,18 +258,7 @@ void msm_rd_debugfs_cleanup(struct drm_minor *minor) return; 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); - kfree(rd); }