Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp35494pxk; Tue, 15 Sep 2020 19:30:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkJAp5uQLjc+a+zpKqYb509MGJYlHY4oZ5CqhcG24ZyCdzV/OLO13rHgwUIPMY7264sowN X-Received: by 2002:a17:906:4c42:: with SMTP id d2mr22395352ejw.506.1600223452862; Tue, 15 Sep 2020 19:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600223452; cv=none; d=google.com; s=arc-20160816; b=o23CBx0vYRPNkLol6KQF53k6C14iQKWaTQlvNA9rbIFYbOcY0IdhDfj64cEO6ZvXxs RnDEh9oGPY/JttpFSym7/LTKyRoVQSyth3vlRbUdR/uDeDT4zP5DfdJKMQfOO2soK2On 4N8M2hkqphEtfu6c1jd8+gDHc09oxFnpnaVQ1PE90AIFN1VWqIcWazbwKcam/T+Xp/Z8 yMyUsyKzkOB9TyQs9OkNnDF6rI/uHCCqYVIcvkEYGE6qtESKcCkeUDeqUUIe0JRh6350 nSZ5pZYW047/l0wtgb/YQwCwMEv7p4Y9m3BHVbDg4SjhUMaI+mX7+aC/9IeD5ODn731F AbjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=tAhaLhjXCMInfCVl20uZqzZhBNNeYHMjYf+el6PjqB8=; b=MZP1461Y5B1zl0q0BvRyy3l3hZopAhQJmfTDCUgYipvVpZ8nzi2TJfUOXUyE46XXnc wJhHIIPAwZlg2J9x3OkZhIsbYVA7xUyHkgT+YCONIuScx2DArXT9bQ9pqtys/gPVxub8 EZDImNz40wJRgd63T7GCIaNPjG1oWFsvlGppCsNucluGMslB3pK6yVdVgQctdVl+wxh7 RsREJx/qdiG8oGllwopimo08CR3bUySwIOlQ+TLz5y+KUufRhDlaaaSbldxdcLoegx/s ZeZl6ZK+3XprUkj3rM7L64+16cSiaKkM1kBqSyvQnG/8qr3Q+7ccyJhVeDcEjT3gDR5o 9mSg== 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 k14si10757904ejx.254.2020.09.15.19.30.30; Tue, 15 Sep 2020 19:30:52 -0700 (PDT) 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 S1726522AbgIPC3D (ORCPT + 99 others); Tue, 15 Sep 2020 22:29:03 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12717 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726402AbgIPC2A (ORCPT ); Tue, 15 Sep 2020 22:28:00 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 6181BEED522A6A6B5DFE; Wed, 16 Sep 2020 10:27:58 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 16 Sep 2020 10:27:50 +0800 From: Liu Shixin To: Thierry Reding , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Jonathan Hunter CC: , , , Liu Shixin Subject: [PATCH -next] PCI: tegra: convert to use DEFINE_SEQ_ATTRIBUTE macro Date: Wed, 16 Sep 2020 10:50:25 +0800 Message-ID: <20200916025025.3992783-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Signed-off-by: Liu Shixin --- drivers/pci/controller/pci-tegra.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c index c1d34353c29b..556c30a718f0 100644 --- a/drivers/pci/controller/pci-tegra.c +++ b/drivers/pci/controller/pci-tegra.c @@ -2564,36 +2564,14 @@ static int tegra_pcie_ports_seq_show(struct seq_file *s, void *v) return 0; } -static const struct seq_operations tegra_pcie_ports_seq_ops = { +static const struct seq_operations tegra_pcie_ports_sops = { .start = tegra_pcie_ports_seq_start, .next = tegra_pcie_ports_seq_next, .stop = tegra_pcie_ports_seq_stop, .show = tegra_pcie_ports_seq_show, }; -static int tegra_pcie_ports_open(struct inode *inode, struct file *file) -{ - struct tegra_pcie *pcie = inode->i_private; - struct seq_file *s; - int err; - - err = seq_open(file, &tegra_pcie_ports_seq_ops); - if (err) - return err; - - s = file->private_data; - s->private = pcie; - - return 0; -} - -static const struct file_operations tegra_pcie_ports_ops = { - .owner = THIS_MODULE, - .open = tegra_pcie_ports_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; +DEFINE_SEQ_ATTRIBUTE(tegra_pcie_ports); static void tegra_pcie_debugfs_exit(struct tegra_pcie *pcie) { @@ -2610,7 +2588,7 @@ static int tegra_pcie_debugfs_init(struct tegra_pcie *pcie) return -ENOMEM; file = debugfs_create_file("ports", S_IFREG | S_IRUGO, pcie->debugfs, - pcie, &tegra_pcie_ports_ops); + pcie, &tegra_pcie_ports_fops); if (!file) goto remove; -- 2.25.1