remoteproc: qcom: Use PTR_ERR_OR_ZERO
authorHimanshu Jha <himanshujha199640@gmail.com>
Tue, 29 Aug 2017 13:43:18 +0000 (19:13 +0530)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 29 Aug 2017 22:34:19 +0000 (15:34 -0700)
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/qcom_adsp_pil.c
drivers/remoteproc/qcom_common.c

index a41d399..d01a8da 100644 (file)
@@ -268,10 +268,7 @@ static int adsp_init_regulator(struct qcom_adsp *adsp)
        regulator_set_load(adsp->cx_supply, 100000);
 
        adsp->px_supply = devm_regulator_get(adsp->dev, "px");
-       if (IS_ERR(adsp->px_supply))
-               return PTR_ERR(adsp->px_supply);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(adsp->px_supply);
 }
 
 static int adsp_request_irq(struct qcom_adsp *adsp,
index 31b8291..7b40b79 100644 (file)
@@ -55,7 +55,7 @@ static int smd_subdev_probe(struct rproc_subdev *subdev)
 
        smd->edge = qcom_smd_register_edge(smd->dev, smd->node);
 
-       return IS_ERR(smd->edge) ? PTR_ERR(smd->edge) : 0;
+       return PTR_ERR_OR_ZERO(smd->edge);
 }
 
 static void smd_subdev_remove(struct rproc_subdev *subdev)