[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200928110957.GA13256@e121166-lin.cambridge.arm.com>
Date: Mon, 28 Sep 2020 12:09:57 +0100
From: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
To: Liu Shixin <liushixin2@...wei.com>
Cc: Thierry Reding <thierry.reding@...il.com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Jonathan Hunter <jonathanh@...dia.com>,
linux-tegra@...r.kernel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] PCI: tegra: convert to use DEFINE_SEQ_ATTRIBUTE
macro
On Wed, Sep 16, 2020 at 10:50:25AM +0800, Liu Shixin wrote:
> Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.
>
> Signed-off-by: Liu Shixin <liushixin2@...wei.com>
> ---
> drivers/pci/controller/pci-tegra.c | 28 +++-------------------------
> 1 file changed, 3 insertions(+), 25 deletions(-)
Applied to pci/tegra, thanks.
Lorenzo
> 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
>
Powered by blists - more mailing lists