Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Bjorn Andersson <andersson@kernel.org>,
	 Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-arm-msm@vger.kernel.org,
	 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: [PATCH 05/10] remoteproc: qcom_q6v5_adsp: Simplify with dev_err_probe()
Date: Fri, 11 Oct 2024 15:09:13 +0200	[thread overview]
Message-ID: <20241011-remote-proc-dev-err-probe-v1-5-5abb4fc61eca@linaro.org> (raw)
In-Reply-To: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org>

Use dev_err_probe() to make error and defer code handling simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/remoteproc/qcom_q6v5_adsp.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
index 572dcb0f055b764f36d0da7c851dcc707bb5ff6e..79dfec517d38980e05ef0196138e6f312c84511d 100644
--- a/drivers/remoteproc/qcom_q6v5_adsp.c
+++ b/drivers/remoteproc/qcom_q6v5_adsp.c
@@ -534,15 +534,11 @@ static const struct rproc_ops adsp_ops = {
 static int adsp_init_clock(struct qcom_adsp *adsp, const char **clk_ids)
 {
 	int num_clks = 0;
-	int i, ret;
+	int i;
 
 	adsp->xo = devm_clk_get(adsp->dev, "xo");
-	if (IS_ERR(adsp->xo)) {
-		ret = PTR_ERR(adsp->xo);
-		if (ret != -EPROBE_DEFER)
-			dev_err(adsp->dev, "failed to get xo clock");
-		return ret;
-	}
+	if (IS_ERR(adsp->xo))
+		return dev_err_probe(adsp->dev, PTR_ERR(adsp->xo), "failed to get xo clock");
 
 	for (i = 0; clk_ids[i]; i++)
 		num_clks++;
@@ -708,10 +704,9 @@ static int adsp_probe(struct platform_device *pdev)
 		return ret;
 
 	ret = qcom_rproc_pds_attach(adsp, desc->pd_names, desc->num_pds);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "Failed to attach proxy power domains\n");
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret,
+				     "Failed to attach proxy power domains\n");
 
 	ret = adsp_init_reset(adsp);
 	if (ret)

-- 
2.43.0


  parent reply	other threads:[~2024-10-11 13:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-11 13:09 [PATCH 00/10] remoteproc: few dev_err_probe() and other cleanups/improvements Krzysztof Kozlowski
2024-10-11 13:09 ` [PATCH 01/10] remoteproc: da8xx: Handle deferred probe Krzysztof Kozlowski
2024-10-11 13:09 ` [PATCH 02/10] remoteproc: da8xx: Simplify with dev_err_probe() Krzysztof Kozlowski
2024-10-11 13:09 ` [PATCH 03/10] remoteproc: ti_k3_r5: " Krzysztof Kozlowski
2024-10-11 13:09 ` [PATCH 04/10] remoteproc: ti_k3_r5: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2024-10-11 13:09 ` Krzysztof Kozlowski [this message]
2024-10-11 13:31   ` [PATCH 05/10] remoteproc: qcom_q6v5_adsp: Simplify with dev_err_probe() Dmitry Baryshkov
2024-10-11 13:09 ` [PATCH 06/10] remoteproc: qcom_q6v5_mss: " Krzysztof Kozlowski
2024-10-11 13:35   ` Dmitry Baryshkov
2024-10-11 13:09 ` [PATCH 07/10] remoteproc: qcom_q6v5_mss: Drop redundant error printks in probe Krzysztof Kozlowski
2024-10-11 13:35   ` Dmitry Baryshkov
2024-10-11 13:09 ` [PATCH 08/10] remoteproc: qcom_q6v5_pas: Simplify with dev_err_probe() Krzysztof Kozlowski
2024-10-11 13:35   ` Dmitry Baryshkov
2024-10-11 13:09 ` [PATCH 09/10] remoteproc: qcom_q6v5_wcss: " Krzysztof Kozlowski
2024-10-11 13:36   ` Dmitry Baryshkov
2024-10-11 13:09 ` [PATCH 10/10] remoteproc: qcom_wcnss_iris: " Krzysztof Kozlowski
2024-10-11 13:36   ` Dmitry Baryshkov
2024-10-15 17:45 ` [PATCH 00/10] remoteproc: few dev_err_probe() and other cleanups/improvements Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241011-remote-proc-dev-err-probe-v1-5-5abb4fc61eca@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=andersson@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox