summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFengguang Wu <fengguang.wu@intel.com>2017-02-04 09:35:32 +0800
committerBjorn Helgaas <bhelgaas@google.com>2017-02-21 15:00:12 -0600
commit11a61a8602812c024d8c404193ce1654ee3b8f08 (patch)
tree3406999ef8e0e3ed29c7346f920c2368c7967d19 /drivers
parent1f6c4501c667a6bf25996f04c9cae49a88d90d01 (diff)
PCI: dwc: Use PTR_ERR_OR_ZERO to simplify code
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR to avoid the following warnings found by scripts/coccinelle/api/ptr_ret.cocci: drivers/pci/dwc/pcie-qcom.c:215:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/pci/dwc/pcie-qcom.c:247:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/pci/dwc/pcie-qcom.c:481:1-3: WARNING: PTR_ERR_OR_ZERO can be used Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> CC: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/dwc/pcie-qcom.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
index 734ba0d4a5c8..1ecff2e07771 100644
--- a/drivers/pci/dwc/pcie-qcom.c
+++ b/drivers/pci/dwc/pcie-qcom.c
@@ -212,10 +212,7 @@ static int qcom_pcie_get_resources_v0(struct qcom_pcie *pcie)
return PTR_ERR(res->por_reset);
res->phy_reset = devm_reset_control_get(dev, "phy");
- if (IS_ERR(res->phy_reset))
- return PTR_ERR(res->phy_reset);
-
- return 0;
+ return PTR_ERR_OR_ZERO(res->phy_reset);
}
static int qcom_pcie_get_resources_v1(struct qcom_pcie *pcie)
@@ -244,10 +241,7 @@ static int qcom_pcie_get_resources_v1(struct qcom_pcie *pcie)
return PTR_ERR(res->slave_bus);
res->core = devm_reset_control_get(dev, "core");
- if (IS_ERR(res->core))
- return PTR_ERR(res->core);
-
- return 0;
+ return PTR_ERR_OR_ZERO(res->core);
}
static void qcom_pcie_deinit_v0(struct qcom_pcie *pcie)
@@ -478,10 +472,7 @@ static int qcom_pcie_get_resources_v2(struct qcom_pcie *pcie)
return PTR_ERR(res->slave_clk);
res->pipe_clk = devm_clk_get(dev, "pipe");
- if (IS_ERR(res->pipe_clk))
- return PTR_ERR(res->pipe_clk);
-
- return 0;
+ return PTR_ERR_OR_ZERO(res->pipe_clk);
}
static int qcom_pcie_init_v2(struct qcom_pcie *pcie)