Skip to content

Commit cd19890

Browse files
Liu ShixinLorenzo Pieralisi
authored andcommitted
PCI: tegra: Convert to use DEFINE_SEQ_ATTRIBUTE macro
Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Link: https://lore.kernel.org/r/20200916025025.3992783-1-liushixin2@huawei.com Signed-off-by: Liu Shixin <liushixin2@huawei.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: Thierry Reding <treding@nvidia.com>
1 parent d27b1cd commit cd19890

1 file changed

Lines changed: 3 additions & 25 deletions

File tree

‎drivers/pci/controller/pci-tegra.c‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,36 +2564,14 @@ static int tegra_pcie_ports_seq_show(struct seq_file *s, void *v)
25642564
return 0;
25652565
}
25662566

2567-
static const struct seq_operations tegra_pcie_ports_seq_ops = {
2567+
static const struct seq_operations tegra_pcie_ports_sops = {
25682568
.start = tegra_pcie_ports_seq_start,
25692569
.next = tegra_pcie_ports_seq_next,
25702570
.stop = tegra_pcie_ports_seq_stop,
25712571
.show = tegra_pcie_ports_seq_show,
25722572
};
25732573

2574-
static int tegra_pcie_ports_open(struct inode *inode, struct file *file)
2575-
{
2576-
struct tegra_pcie *pcie = inode->i_private;
2577-
struct seq_file *s;
2578-
int err;
2579-
2580-
err = seq_open(file, &tegra_pcie_ports_seq_ops);
2581-
if (err)
2582-
return err;
2583-
2584-
s = file->private_data;
2585-
s->private = pcie;
2586-
2587-
return 0;
2588-
}
2589-
2590-
static const struct file_operations tegra_pcie_ports_ops = {
2591-
.owner = THIS_MODULE,
2592-
.open = tegra_pcie_ports_open,
2593-
.read = seq_read,
2594-
.llseek = seq_lseek,
2595-
.release = seq_release,
2596-
};
2574+
DEFINE_SEQ_ATTRIBUTE(tegra_pcie_ports);
25972575

25982576
static void tegra_pcie_debugfs_exit(struct tegra_pcie *pcie)
25992577
{
@@ -2606,7 +2584,7 @@ static void tegra_pcie_debugfs_init(struct tegra_pcie *pcie)
26062584
pcie->debugfs = debugfs_create_dir("pcie", NULL);
26072585

26082586
debugfs_create_file("ports", S_IFREG | S_IRUGO, pcie->debugfs, pcie,
2609-
&tegra_pcie_ports_ops);
2587+
&tegra_pcie_ports_fops);
26102588
}
26112589

26122590
static int tegra_pcie_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)