[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201116165407.8050-1-sudipm.mukherjee@gmail.com>
Date: Mon, 16 Nov 2020 16:54:07 +0000
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Thierry Reding <thierry.reding@...il.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Jonathan Hunter <jonathanh@...dia.com>
Cc: linux-kernel@...r.kernel.org, linux-safety@...ts.elisa.tech,
linux-tegra@...r.kernel.org, linux-pci@...r.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO
Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code,
we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then
doing 'return 0'.
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@...il.com>
---
drivers/pci/controller/pci-tegra.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
index 8fcabed7c6a6..4c52b2d58645 100644
--- a/drivers/pci/controller/pci-tegra.c
+++ b/drivers/pci/controller/pci-tegra.c
@@ -1308,10 +1308,8 @@ static int tegra_pcie_resets_get(struct tegra_pcie *pcie)
return PTR_ERR(pcie->afi_rst);
pcie->pcie_xrst = devm_reset_control_get_exclusive(dev, "pcie_x");
- if (IS_ERR(pcie->pcie_xrst))
- return PTR_ERR(pcie->pcie_xrst);
- return 0;
+ return PTR_ERR_OR_ZERO(pcie->pcie_xrst);
}
static int tegra_pcie_phys_get_legacy(struct tegra_pcie *pcie)
--
2.11.0
Powered by blists - more mailing lists