From patchwork Mon Nov 27 10:07:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 841576 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IdPunwjj"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yljDk2R0Rz9s7F for ; Mon, 27 Nov 2017 21:08:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751723AbdK0KIg (ORCPT ); Mon, 27 Nov 2017 05:08:36 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:43755 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbdK0KIO (ORCPT ); Mon, 27 Nov 2017 05:08:14 -0500 Received: by mail-wm0-f68.google.com with SMTP id x63so32816522wmf.2 for ; Mon, 27 Nov 2017 02:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kduwWuCCwJiixuZHVKsFx/cueG2xMuDB98r0cs46SQw=; b=IdPunwjjFr2HGxJE0GH9FjVjKm0hC+Ls+I/n8UaE1WcZAaNcY97QzSKwghsEzLme0E 3eDSdFKYKyOHIHg33IfaOKH2x7GR06PWJ92jjx3PcBDaxmcsoeLDKB+G8xb6W5tY7JTM futL0X/zIZDUSblqXzZNvpFvvd0MjANS6HuACrNcM/7dwL30aIEuULLsnpE2mrOZa6Sh 7dlA45FPFlD9Poh3q/9OH6cVQppdn4MszB2vExGSYXhNO3ybWK+z/Odg3xrc3NusPQqn KLDr5bufEiPYjrHnmWPCTTediMDBE/FboSiF04qK+NdXIexLw2fQC5gTZ6uDYTgi7sov zVzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kduwWuCCwJiixuZHVKsFx/cueG2xMuDB98r0cs46SQw=; b=CR6cPOIDFaI4/Zf3jAgFZXSMSAGU+DbmW21etPAxfbvFtImRq/e2+UtaxlZEiNg8ov BmNvlwm80n+4JQy75RRWQFTJ7akQjydfvnXf4x2Ms8+2MRT7VAFxueQ6hLa48iJBDLcD 4QTXVq4d2luyngPks16WE94hIUnGYqpK+7ZLTUEEiTbxoLrkukqR/76qwpaIXkdN7Cx2 iw60ZCcaR+i1IbeFZZl0yxM8kFbOzb49IX0yV6O1jCs3KIKmSTxxfmR1AbQeQeKOpMF4 Pt80Gg2csnueJfTtJ42jWjx6N4yt6pEk8V39Ee+0FFgOwFEAmcM7WFoL7s+2KpR4M1Ex 5p6Q== X-Gm-Message-State: AJaThX5ydG00ZmLbb+zh6pGJ9r8cags7AR7P2GQ9Z2WKMkkVjlX0tE8m tdUNfwrFTMoUh9w+k82PoIM= X-Google-Smtp-Source: AGs4zMY8n9WN37ag+H83JRf4QpnYoRrpSSQUNLFp403jlZNjgsTQkYf2XOpZ4MrzRRGM5xaADhKlaA== X-Received: by 10.28.194.139 with SMTP id s133mr15129513wmf.14.1511777293226; Mon, 27 Nov 2017 02:08:13 -0800 (PST) Received: from localhost (p200300E41F200F003F65F430A8AE2E44.dip0.t-ipconnect.de. [2003:e4:1f20:f00:3f65:f430:a8ae:2e44]) by smtp.gmail.com with ESMTPSA id m50sm3091289wrm.12.2017.11.27.02.08.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Nov 2017 02:08:12 -0800 (PST) From: Thierry Reding To: Thierry Reding Cc: dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org Subject: [PATCH 09/13] drm/tegra: sor: Root debugfs files at the connector Date: Mon, 27 Nov 2017 11:07:54 +0100 Message-Id: <20171127100758.22149-10-thierry.reding@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171127100758.22149-1-thierry.reding@gmail.com> References: <20171127100758.22149-1-thierry.reding@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding Rather create new files within the top-level DRM device's debugfs node, add the SOR specific files to the connector's debugfs node. This avoids the need to come up with subdirectory names and is also more intuitive. Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/sor.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 75b21dbaa8f0..f40fc987900c 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -184,7 +184,6 @@ struct tegra_sor { struct drm_info_list *debugfs_files; struct drm_minor *minor; - struct dentry *debugfs; const struct tegra_sor_ops *ops; @@ -1260,14 +1259,10 @@ static const struct drm_info_list debugfs_files[] = { static int tegra_sor_debugfs_init(struct tegra_sor *sor, struct drm_minor *minor) { - const char *name = sor->soc->supports_dp ? "sor1" : "sor"; + struct dentry *root = sor->output.connector.debugfs_entry; unsigned int i; int err; - sor->debugfs = debugfs_create_dir(name, minor->debugfs_root); - if (!sor->debugfs) - return -ENOMEM; - sor->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files), GFP_KERNEL); if (!sor->debugfs_files) { @@ -1280,7 +1275,7 @@ static int tegra_sor_debugfs_init(struct tegra_sor *sor, err = drm_debugfs_create_files(sor->debugfs_files, ARRAY_SIZE(debugfs_files), - sor->debugfs, minor); + root, minor); if (err < 0) goto free; @@ -1292,13 +1287,14 @@ static int tegra_sor_debugfs_init(struct tegra_sor *sor, kfree(sor->debugfs_files); sor->debugfs_files = NULL; remove: - debugfs_remove_recursive(sor->debugfs); - sor->debugfs = NULL; + debugfs_remove_recursive(root); return err; } static void tegra_sor_debugfs_exit(struct tegra_sor *sor) { + struct dentry *root = sor->output.connector.debugfs_entry; + drm_debugfs_remove_files(sor->debugfs_files, ARRAY_SIZE(debugfs_files), sor->minor); sor->minor = NULL; @@ -1306,8 +1302,7 @@ static void tegra_sor_debugfs_exit(struct tegra_sor *sor) kfree(sor->debugfs_files); sor->debugfs_files = NULL; - debugfs_remove_recursive(sor->debugfs); - sor->debugfs = NULL; + debugfs_remove_recursive(root); } static void tegra_sor_connector_reset(struct drm_connector *connector)