diff mbox

[RFC,5/5] PCI: tegra: use seq_open_data

Message ID 20180301233724.20440-5-linux@rasmusvillemoes.dk (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Rasmus Villemoes March 1, 2018, 11:37 p.m. UTC
Simplify the code slightly by having seq_open_data do the ->private
assignment.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/pci/host/pci-tegra.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Thierry Reding March 2, 2018, 10:42 a.m. UTC | #1
On Fri, Mar 02, 2018 at 12:37:24AM +0100, Rasmus Villemoes wrote:
> Simplify the code slightly by having seq_open_data do the ->private
> assignment.
> 
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
>  drivers/pci/host/pci-tegra.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)

I had to go hunt for patch 1/5 to be able to tell if this is indeed
equivalent. It is, so:

Reviewed-by: Thierry Reding <treding@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Lorenzo Pieralisi March 7, 2018, 12:41 p.m. UTC | #2
On Fri, Mar 02, 2018 at 11:42:07AM +0100, Thierry Reding wrote:
> On Fri, Mar 02, 2018 at 12:37:24AM +0100, Rasmus Villemoes wrote:
> > Simplify the code slightly by having seq_open_data do the ->private
> > assignment.
> > 
> > Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> > ---
> >  drivers/pci/host/pci-tegra.c | 11 +----------
> >  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> I had to go hunt for patch 1/5 to be able to tell if this is indeed
> equivalent. It is, so:
> 
> Reviewed-by: Thierry Reding <treding@nvidia.com>
> Acked-by: Thierry Reding <treding@nvidia.com>

I can't apply this patch standalone so I assume this will go via
some other tree; I will drop it from the PCI patch queue, if I
should not please do let me know.

Thanks,
Lorenzo
Lorenzo Pieralisi April 25, 2018, 9:38 a.m. UTC | #3
On Wed, Mar 07, 2018 at 12:41:05PM +0000, Lorenzo Pieralisi wrote:
> On Fri, Mar 02, 2018 at 11:42:07AM +0100, Thierry Reding wrote:
> > On Fri, Mar 02, 2018 at 12:37:24AM +0100, Rasmus Villemoes wrote:
> > > Simplify the code slightly by having seq_open_data do the ->private
> > > assignment.
> > > 
> > > Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> > > ---
> > >  drivers/pci/host/pci-tegra.c | 11 +----------
> > >  1 file changed, 1 insertion(+), 10 deletions(-)
> > 
> > I had to go hunt for patch 1/5 to be able to tell if this is indeed
> > equivalent. It is, so:
> > 
> > Reviewed-by: Thierry Reding <treding@nvidia.com>
> > Acked-by: Thierry Reding <treding@nvidia.com>
> 
> I can't apply this patch standalone so I assume this will go via
> some other tree; I will drop it from the PCI patch queue, if I
> should not please do let me know.

I would kindly ask you some feedback - where are we with this patch
series ? Please let me know if should consider it for the pci tree
as per my request above.

Thanks,
Lorenzo
diff mbox

Patch

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index dd9b3bcc41c3..7921428786aa 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -2188,17 +2188,8 @@  static const struct seq_operations tegra_pcie_ports_seq_ops = {
 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;
+	return seq_open_data(file, &tegra_pcie_ports_seq_ops, pcie);
 }
 
 static const struct file_operations tegra_pcie_ports_ops = {