Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp480187lqh; Thu, 28 Mar 2024 07:35:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVsvj1Hae7bjSGyQCanT6U8MfGxhJJn+Kp83qEl9xaVf7rPjTO0OfZLOrKqn/601cc5eBbsirAH/aldkcYE4RkhcuVi1iU2GHPM8ajxyg== X-Google-Smtp-Source: AGHT+IEIP3WzmQ+HzzPDWBXbAzFAQ3IIhrWufGlmnU/BDYuKjkfHKIAFFOzujZqJ0g83TpfwPs6x X-Received: by 2002:a50:ab15:0:b0:568:d312:4483 with SMTP id s21-20020a50ab15000000b00568d3124483mr2280882edc.5.1711636541818; Thu, 28 Mar 2024 07:35:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711636541; cv=pass; d=google.com; s=arc-20160816; b=NUBuGwFh1Zrd/sSuL7vt5pPXTKV6vXkZgGkC46J5FKd2wx4SAhX9WIv8aOIaGQ3tid K2EhJM2Xj67lSgYotv4XaeQryQNqd6SPZSj+kd8TR9FpVQ5oO7IsP4MCc08m0clrpmZS NTWBgkVelOLLVENa0Dgsjlt+CU6dJUQxV8RqY6lGK7aipbcsU70X/fiKfoSaoNS0g7/H jDDQX2ZHul0cYMArQWNY+FbiBS2xDtmq3/KGKFLZtMbhlRnnqB8D8Nwz7ZHuMSAGkab3 /klYRVI6INH9mRDHU382zM6mHMNWcaCK4xS8FA/Dt9i5oGzmGdAE6UhwGJVHlT64+AHt DM5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=vJYvL+FVVsv7dL2duLnNg9qXL/X2A1B1Ep94pPz6Cfo=; fh=SXWstRefROG6Gmk6nMJHio9uD832eRzLu5zkpfVox3E=; b=03S9VB/eo/75zxdCA6Fi1J1AVRtSTSxGTDo8hojKim9a3i+dV7dJVUqOzr2vuYnoFe S5TPsQmaiViTtGOtWxTVgGOzZMEnhIx1DvUZNPoYvJMZ675kXqJZza+ZfGteQbmNRDZd ODKDnFLLnObIgmNIOt5pocLsxjS1YkqhuVPqPH03BqUSm0SzUk5P6vnPD44jVdvlejfm l+BBh63nBMXl2kw5KbKTZ9+EQphWyiV+FFb7YDbyTqbNWAD3Z8O3SgylsOnsPeKC9lDb me9a/3temu4d+t71llttJjno6dGNPqEfPCBubVEm1oDBa/ZHD3kmZ/lZwnA3G3fO8otz c16Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="N/g6lUw/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e4-20020a50d4c4000000b0056c3c5dfca7si793708edj.21.2024.03.28.07.35.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 07:35:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="N/g6lUw/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 649911F273A6 for ; Thu, 28 Mar 2024 14:35:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3C4712AAC3; Thu, 28 Mar 2024 14:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N/g6lUw/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E91683A14; Thu, 28 Mar 2024 14:35:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636524; cv=none; b=U+v1QotvCPHo9yBvGtXBs04YkomFTdUdRJMLyBJVByaxQVgP0H7fzb027TjwypJj+hnLkwxv3yxP848eFCMJB91p9Y3Ujw2LDU7NXEfrRiwLd3A1vfoHh9neJH5R3PxDnVLMHjvQUUznEIVDus7IDv3piBAr415VLNx1FEUfQNc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636524; c=relaxed/simple; bh=qX+y/C0y9wroOwogb2KVMotUMDlmKrr2lqvWjHDmCwo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oGBCD2KZekawD4T+rlepeLMJ5xXhyIpmhSmLKHvJBXR19hM6wy7H/0KsdhNZTSa4TidYZg0MBcfeD5aB64x5BBZBT6hcrO/ncPbGOBYnc5BT2/GT55tWU15j1OTNqPT9V4KvtzVhLRs0xeADYhlg3GM1LFroul1hnBZx+t1K8lU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N/g6lUw/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A2D2C43390; Thu, 28 Mar 2024 14:35:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711636524; bh=qX+y/C0y9wroOwogb2KVMotUMDlmKrr2lqvWjHDmCwo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=N/g6lUw/V5+Dn1CyziswhSJowu97u4s2RhHaKs24ha2wzOFHMoqhlqX2BSDHlRbnm sxw1PaqaqkBiZgk1IpkoVwIj47Q3DkNeVIAuP6fz+GGqC8pD6Dkcup8s7+jAdEZqhe 4QuVCV8VWhWafV3IRoz+tDEa1zogRKjZTbeptgp1+uYgHl/VkEUcoQ2XAW83PP1uSs WIJD30mQp+kr4HcqcJB2vUV4oxy4ZzDnchBxXdDnJZfJPfFfdJlFNRr3hBxiRSS9oS VIhScfqaP+TDrsKW8V/z1ezUpqX+HNsg+gsarvUgHqEFPKQo50PYZvZJFT1uFYVgS3 idaUjqX6hqWqg== From: Bjorn Andersson Date: Thu, 28 Mar 2024 07:40:00 -0700 Subject: [PATCH v2 1/6] drm/msm/dp: Drop unused dp_debug struct Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240328-msm-dp-cleanup-v2-1-a5aed9798d32@quicinc.com> References: <20240328-msm-dp-cleanup-v2-0-a5aed9798d32@quicinc.com> In-Reply-To: <20240328-msm-dp-cleanup-v2-0-a5aed9798d32@quicinc.com> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Bjorn Andersson X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=5776; i=quic_bjorande@quicinc.com; h=from:subject:message-id; bh=gRF6CjyySMH8PFcvFDTXJIE5Z9XcpS26yBa7sMbPb1U=; b=owEBgwJ8/ZANAwAIAQsfOT8Nma3FAcsmYgBmBYFI0fEm6X/VhX6veAPV4GpPT5Pp0nKWhL7cJ GG6nfMN+g2JAkkEAAEIADMWIQQF3gPMXzXqTwlm1SULHzk/DZmtxQUCZgWBSBUcYW5kZXJzc29u QGtlcm5lbC5vcmcACgkQCx85Pw2ZrcUijA//aLsOsxPQ4eBuQRlVBBO95JgSvcrEFoWsa8unR7u mZuelXjP6It8vFchV3wbS8nmeQcHONIo3LChOtkRW8Aqna2FXN0tzsyexU4bZWloYJgR/ycOfyx BLSqYot6KxTWnSZ9RiPq9Ntk0fdHj99isEnvaxRfjHEBCBQdohkfxqtSXXWdmlVM3k0kVGk247C t7PqiW7vC98HwNwjMT4IkZIGq6yfssP5Vjomm6e/97LBLKDkXprx75NTyISIbp3aBNbhxrDQh69 cIZ4TOtEo8A/FAlSlNiWpZQEV3DGeN5igqwjxK9fNroZwtJMSPdPlH509B1EGnLEW5o0sHfdN0w iXSFzjoZY8L7fLRC6bRAP5dx6+q1EiqKXvfzi7IP/r4wjrbRcyTzlckhdzpJsya6pXPhsWko4/c +ClMlN8nJfG5BedVa7nVUHqt0CVmQUq2EZQYok04NsuzyHCXnkrjD3LAuanB8rXl0OGd9m7JhY3 cmIMXJLyhfi/ZHnTcu3IGl45RJB/scuyl31PGN7Difgpt+SE0XmzZjgjP2JMSF7MTDZBDIgkazm 512UIWqbkA+FfVLjkKIs4ysOimrzcfjL14d6PVp4Kn0mAvJ2J/SVq3OkKQsJsQzn5yRY/c5doyD 6z4SYIMiFot3JUaFZUe/S6azMvlSdOMPyVWeZzVgFRSw= X-Developer-Key: i=quic_bjorande@quicinc.com; a=openpgp; fpr=05DE03CC5F35EA4F0966D5250B1F393F0D99ADC5 From: Bjorn Andersson The members of struct dp_debug are no longer used, so the only purpose of this struct is as a type of the return value of dp_debug_get(), to signal success/error. Drop the struct in favor of signalling the result of initialization using an int, then merge dp_debug_get() with dp_debug_init() to avoid the unnecessar boilerplate code. Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/dp/dp_debug.c | 59 +++++++++++-------------------------- drivers/gpu/drm/msm/dp/dp_debug.h | 38 +++++++----------------- drivers/gpu/drm/msm/dp/dp_display.c | 10 ++----- 3 files changed, 31 insertions(+), 76 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c b/drivers/gpu/drm/msm/dp/dp_debug.c index eca5a02f9003..b8611f6d2296 100644 --- a/drivers/gpu/drm/msm/dp/dp_debug.c +++ b/drivers/gpu/drm/msm/dp/dp_debug.c @@ -21,8 +21,6 @@ struct dp_debug_private { struct dp_link *link; struct dp_panel *panel; struct drm_connector *connector; - - struct dp_debug dp_debug; }; static int dp_debug_show(struct seq_file *seq, void *p) @@ -199,10 +197,24 @@ static const struct file_operations test_active_fops = { .write = dp_test_active_write }; -static void dp_debug_init(struct dp_debug *dp_debug, struct dentry *root, bool is_edp) +int dp_debug_init(struct device *dev, struct dp_panel *panel, + struct dp_link *link, + struct drm_connector *connector, + struct dentry *root, bool is_edp) { - struct dp_debug_private *debug = container_of(dp_debug, - struct dp_debug_private, dp_debug); + struct dp_debug_private *debug; + + if (!dev || !panel || !link) { + DRM_ERROR("invalid input\n"); + return -EINVAL; + } + + debug = devm_kzalloc(dev, sizeof(*debug), GFP_KERNEL); + if (!debug) + return -ENOMEM; + + debug->link = link; + debug->panel = panel; debugfs_create_file("dp_debug", 0444, root, debug, &dp_debug_fops); @@ -220,41 +232,6 @@ static void dp_debug_init(struct dp_debug *dp_debug, struct dentry *root, bool i root, debug, &dp_test_type_fops); } -} -struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel, - struct dp_link *link, - struct drm_connector *connector, - struct dentry *root, bool is_edp) -{ - struct dp_debug_private *debug; - struct dp_debug *dp_debug; - int rc; - - if (!dev || !panel || !link) { - DRM_ERROR("invalid input\n"); - rc = -EINVAL; - goto error; - } - - debug = devm_kzalloc(dev, sizeof(*debug), GFP_KERNEL); - if (!debug) { - rc = -ENOMEM; - goto error; - } - - debug->dp_debug.debug_en = false; - debug->link = link; - debug->panel = panel; - - dp_debug = &debug->dp_debug; - dp_debug->vdisplay = 0; - dp_debug->hdisplay = 0; - dp_debug->vrefresh = 0; - - dp_debug_init(dp_debug, root, is_edp); - - return dp_debug; - error: - return ERR_PTR(rc); + return 0; } diff --git a/drivers/gpu/drm/msm/dp/dp_debug.h b/drivers/gpu/drm/msm/dp/dp_debug.h index 9b3b2e702f65..7e1aa892fc09 100644 --- a/drivers/gpu/drm/msm/dp/dp_debug.h +++ b/drivers/gpu/drm/msm/dp/dp_debug.h @@ -9,22 +9,6 @@ #include "dp_panel.h" #include "dp_link.h" -/** - * struct dp_debug - * @debug_en: specifies whether debug mode enabled - * @vdisplay: used to filter out vdisplay value - * @hdisplay: used to filter out hdisplay value - * @vrefresh: used to filter out vrefresh value - * @tpg_state: specifies whether tpg feature is enabled - */ -struct dp_debug { - bool debug_en; - int aspect_ratio; - int vdisplay; - int hdisplay; - int vrefresh; -}; - #if defined(CONFIG_DEBUG_FS) /** @@ -41,22 +25,22 @@ struct dp_debug { * This function sets up the debug module and provides a way * for debugfs input to be communicated with existing modules */ -struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel, - struct dp_link *link, - struct drm_connector *connector, - struct dentry *root, - bool is_edp); +int dp_debug_init(struct device *dev, struct dp_panel *panel, + struct dp_link *link, + struct drm_connector *connector, + struct dentry *root, + bool is_edp); #else static inline -struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel, - struct dp_link *link, - struct drm_connector *connector, - struct dentry *root, - bool is_edp) +int dp_debug_init(struct device *dev, struct dp_panel *panel, + struct dp_link *link, + struct drm_connector *connector, + struct dentry *root, + bool is_edp) { - return ERR_PTR(-EINVAL); + return -EINVAL; } #endif /* defined(CONFIG_DEBUG_FS) */ diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index c4cb82af5c2f..ba658c1637d1 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -93,7 +93,6 @@ struct dp_display_private { struct dp_link *link; struct dp_panel *panel; struct dp_ctrl *ctrl; - struct dp_debug *debug; struct dp_display_mode dp_mode; struct msm_dp dp_display; @@ -1431,14 +1430,9 @@ void dp_display_debugfs_init(struct msm_dp *dp_display, struct dentry *root, boo dp = container_of(dp_display, struct dp_display_private, dp_display); dev = &dp->dp_display.pdev->dev; - dp->debug = dp_debug_get(dev, dp->panel, - dp->link, dp->dp_display.connector, - root, is_edp); - if (IS_ERR(dp->debug)) { - rc = PTR_ERR(dp->debug); + rc = dp_debug_init(dev, dp->panel, dp->link, dp->dp_display.connector, root, is_edp); + if (rc) DRM_ERROR("failed to initialize debug, rc = %d\n", rc); - dp->debug = NULL; - } } int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, -- 2.43.0