All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remoteproc: qcom: Use PTR_ERR_OR_ZERO
@ 2017-08-29 13:43 Himanshu Jha
  2017-08-29 22:35 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Himanshu Jha @ 2017-08-29 13:43 UTC (permalink / raw)
  To: ohad; +Cc: bjorn.andersson, linux-remoteproc, linux-kernel, Himanshu Jha

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

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---
 drivers/remoteproc/qcom_adsp_pil.c | 5 +----
 drivers/remoteproc/qcom_common.c   | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers/remoteproc/qcom_adsp_pil.c
index a41d399..d01a8da 100644
--- a/drivers/remoteproc/qcom_adsp_pil.c
+++ b/drivers/remoteproc/qcom_adsp_pil.c
@@ -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,
diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
index 31b8291..7b40b79 100644
--- a/drivers/remoteproc/qcom_common.c
+++ b/drivers/remoteproc/qcom_common.c
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] remoteproc: qcom: Use PTR_ERR_OR_ZERO
  2017-08-29 13:43 [PATCH] remoteproc: qcom: Use PTR_ERR_OR_ZERO Himanshu Jha
@ 2017-08-29 22:35 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2017-08-29 22:35 UTC (permalink / raw)
  To: Himanshu Jha; +Cc: ohad, linux-remoteproc, linux-kernel

On Tue 29 Aug 06:43 PDT 2017, Himanshu Jha wrote:

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

Applied for v4.14

Thank you,
Bjorn

> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
> ---
>  drivers/remoteproc/qcom_adsp_pil.c | 5 +----
>  drivers/remoteproc/qcom_common.c   | 2 +-
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers/remoteproc/qcom_adsp_pil.c
> index a41d399..d01a8da 100644
> --- a/drivers/remoteproc/qcom_adsp_pil.c
> +++ b/drivers/remoteproc/qcom_adsp_pil.c
> @@ -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,
> diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
> index 31b8291..7b40b79 100644
> --- a/drivers/remoteproc/qcom_common.c
> +++ b/drivers/remoteproc/qcom_common.c
> @@ -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)
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-29 22:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 13:43 [PATCH] remoteproc: qcom: Use PTR_ERR_OR_ZERO Himanshu Jha
2017-08-29 22:35 ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.