Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp468749pxb; Tue, 3 Nov 2020 04:34:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwytCcPVEUBj3tbWtLKobr5JqnXyzy2mhfzktgUD3fA60Ugfkf+Z2PLEk3ZUOQC0tPntLnv X-Received: by 2002:a17:906:b783:: with SMTP id dt3mr19723211ejb.534.1604406867581; Tue, 03 Nov 2020 04:34:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604406867; cv=none; d=google.com; s=arc-20160816; b=YKssQbWCI7s9L3gWRBJvlOvpWuOUfJKRg5IqWLMiiwCYcuOk1ADpjMndaBQKQ73ZGI G2w77M6mCa92Y54BR3j/9+DlDvdrNa/7P1QE6DNRfJ2fF5s7dpKo9uCCUszCFmIOvABe kxKrS2P2DRFKPEyQLPK/uW1D1DCr745w4MHnSbxTfINq6PenTKBSOc2jmhuxd7ZJc/VI DLbCCb3qN52jq6TsuRcEe6b3hEzKVJl2Li5LkI2cEjK3RItSJmpNniIoHQQ4PFznQv8U IV5rOxlamZLqsAoYVnTAdDam/qT+G7qGV8ZLIe9LgFzpF0tYJc6XCG8tyaFJX4V88W48 dzhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=dI0UP9loLbhhtF7waIeHa1Zq4KxbI5VaqMxExA8xQRs=; b=SdahooDbiuxNsr2BVH2+qRGyxhSaPbbxFdBUzn+kTDApYE+fM38ajvwjKHS+XAK2NB 4cv/H4SjCTW5KykEWpwoC8L2+2GR0hQRV3UyqBjYVw+UXMYzwsbkeCKFOMCTHkqCKyPR CFBLZ8U4oX+ieUfVlZtxhExDAH+8uL370qzZ7ETdr3KZB7GnEA1eJgwZpJu3Qh4MrZ/y HcaGZpXPS8RS2/rq7+K0Cqk9fjRqMGkbf1Jn3hpuEywYLAc17FujrP4Hr8JMIiXj+GPg 4KE8JADJEMnU9dIywu7hvlt5zMikJW9yLHig+0lvFqJzHEdOvKmZF0VyAHzK3nB0O7ia 4g0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si6358913edq.105.2020.11.03.04.34.04; Tue, 03 Nov 2020 04:34:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729013AbgKCM3X (ORCPT + 99 others); Tue, 3 Nov 2020 07:29:23 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:7585 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728168AbgKCM3V (ORCPT ); Tue, 3 Nov 2020 07:29:21 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CQTcB23vzzLt6w; Tue, 3 Nov 2020 20:29:14 +0800 (CST) Received: from huawei.com (10.69.192.56) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Tue, 3 Nov 2020 20:29:10 +0800 From: Luo Jiaxing To: , , CC: , , , , , , , , , , , Subject: [PATCH v3 5/5] drm/i915/display: Introduce DEFINE_SHOW_STORE_ATTRIBUTE for debugfs Date: Tue, 3 Nov 2020 20:29:44 +0800 Message-ID: <1604406584-53926-6-git-send-email-luojiaxing@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604406584-53926-1-git-send-email-luojiaxing@huawei.com> References: <1604406584-53926-1-git-send-email-luojiaxing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Seq introduce a new helper macro DEFINE_SHOW_STORE_ATTRIBUTE for Read-Write file, so we apply it at drm/i915/display to reduce some duplicated code. Signed-off-by: Luo Jiaxing --- .../gpu/drm/i915/display/intel_display_debugfs.c | 55 ++-------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index 0bf31f9..8bf839f 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -1329,21 +1329,7 @@ static int i915_displayport_test_active_show(struct seq_file *m, void *data) return 0; } -static int i915_displayport_test_active_open(struct inode *inode, - struct file *file) -{ - return single_open(file, i915_displayport_test_active_show, - inode->i_private); -} - -static const struct file_operations i915_displayport_test_active_fops = { - .owner = THIS_MODULE, - .open = i915_displayport_test_active_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = i915_displayport_test_active_write -}; +DEFINE_SHOW_STORE_ATTRIBUTE(i915_displayport_test_active); static int i915_displayport_test_data_show(struct seq_file *m, void *data) { @@ -1733,19 +1719,7 @@ static ssize_t i915_hpd_storm_ctl_write(struct file *file, return len; } -static int i915_hpd_storm_ctl_open(struct inode *inode, struct file *file) -{ - return single_open(file, i915_hpd_storm_ctl_show, inode->i_private); -} - -static const struct file_operations i915_hpd_storm_ctl_fops = { - .owner = THIS_MODULE, - .open = i915_hpd_storm_ctl_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = i915_hpd_storm_ctl_write -}; +DEFINE_SHOW_STORE_ATTRIBUTE(i915_hpd_storm_ctl); static int i915_hpd_short_storm_ctl_show(struct seq_file *m, void *data) { @@ -1811,14 +1785,7 @@ static ssize_t i915_hpd_short_storm_ctl_write(struct file *file, return len; } -static const struct file_operations i915_hpd_short_storm_ctl_fops = { - .owner = THIS_MODULE, - .open = i915_hpd_short_storm_ctl_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = i915_hpd_short_storm_ctl_write, -}; +DEFINE_SHOW_STORE_ATTRIBUTE(i915_hpd_short_storm_ctl); static int i915_drrs_ctl_set(void *data, u64 val) { @@ -2181,21 +2148,7 @@ static ssize_t i915_dsc_fec_support_write(struct file *file, return len; } -static int i915_dsc_fec_support_open(struct inode *inode, - struct file *file) -{ - return single_open(file, i915_dsc_fec_support_show, - inode->i_private); -} - -static const struct file_operations i915_dsc_fec_support_fops = { - .owner = THIS_MODULE, - .open = i915_dsc_fec_support_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = i915_dsc_fec_support_write -}; +DEFINE_SHOW_STORE_ATTRIBUTE(i915_dsc_fec_support); /** * intel_connector_debugfs_add - add i915 specific connector debugfs files -- 2.7.4