Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1722498

[PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO

From Himanshu Jha <himanshujha199640@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO
Date 2017-08-29 15:40 +0200
Message-ID <ujOUi-3dt-29@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---
 drivers/pci/host/pci-tegra.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 9c40da5..90cda5b 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1156,10 +1156,7 @@ 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.7.4

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Himanshu Jha <himanshujha199640@gmail.com> - 2017-08-29 15:40 +0200
  Re: [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Thierry Reding <thierry.reding@gmail.com> - 2017-08-29 16:00 +0200
    Re: [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Himanshu Jha <himanshujha199640@gmail.com> - 2017-08-29 16:20 +0200
      Re: [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Thierry Reding <thierry.reding@gmail.com> - 2017-08-29 17:20 +0200
    Re: [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Bjorn Helgaas <helgaas@kernel.org> - 2017-08-30 16:00 +0200
      Re: [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Thierry Reding <thierry.reding@gmail.com> - 2017-08-30 16:30 +0200
        Re: [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Bjorn Helgaas <helgaas@kernel.org> - 2017-08-30 18:30 +0200

csiph-web