linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Drew Fustini <drew@pdp7.com>, Guo Ren <guoren@kernel.org>,
	 Fu Wei <wefu@redhat.com>, Bartosz Golaszewski <brgl@bgdev.pl>,
	 Ulf Hansson <ulf.hansson@linaro.org>,
	 Michal Wilczynski <m.wilczynski@samsung.com>
Cc: linux-riscv@lists.infradead.org, linux-pm@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	 Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 5/5] pwrseq: thead-gpu: use new defines for match() return values
Date: Tue, 24 Jun 2025 16:32:22 +0200	[thread overview]
Message-ID: <20250624-pwrseq-match-defines-v1-5-a59d90a951f1@linaro.org> (raw)
In-Reply-To: <20250624-pwrseq-match-defines-v1-0-a59d90a951f1@linaro.org>

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Replace the magic numbers with proper defines we now have in the header.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/power/sequencing/pwrseq-thead-gpu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/power/sequencing/pwrseq-thead-gpu.c b/drivers/power/sequencing/pwrseq-thead-gpu.c
index 855c6cc4f3b5bd1aa6e93305af0417d5791b092d..7c82a10ca9f6917e673711c55dd5e58e58dc8f5c 100644
--- a/drivers/power/sequencing/pwrseq-thead-gpu.c
+++ b/drivers/power/sequencing/pwrseq-thead-gpu.c
@@ -124,24 +124,25 @@ static int pwrseq_thead_gpu_match(struct pwrseq_device *pwrseq,
 
 	/* We only match the specific T-HEAD TH1520 GPU compatible */
 	if (!of_device_is_compatible(dev->of_node, "thead,th1520-gpu"))
-		return 0;
+		return PWRSEQ_NO_MATCH;
 
 	ret = of_parse_phandle_with_args(dev->of_node, "power-domains",
 					 "#power-domain-cells", 0, &pwr_spec);
 	if (ret)
-		return 0;
+		return PWRSEQ_NO_MATCH;
 
 	/* Additionally verify consumer device has AON as power-domain */
 	if (pwr_spec.np != ctx->aon_node || pwr_spec.args[0] != TH1520_GPU_PD) {
 		of_node_put(pwr_spec.np);
-		return 0;
+		return PWRSEQ_NO_MATCH;
 	}
 
 	of_node_put(pwr_spec.np);
 
 	/* If a consumer is already bound, only allow a re-match from it */
 	if (ctx->consumer_node)
-		return ctx->consumer_node == dev->of_node ? 1 : 0;
+		return ctx->consumer_node == dev->of_node ?
+				PWRSEQ_MATCH_OK : PWRSEQ_NO_MATCH;
 
 	ctx->num_clks = ARRAY_SIZE(clk_names);
 	ctx->clks = kcalloc(ctx->num_clks, sizeof(*ctx->clks), GFP_KERNEL);
@@ -163,7 +164,7 @@ static int pwrseq_thead_gpu_match(struct pwrseq_device *pwrseq,
 
 	ctx->consumer_node = of_node_get(dev->of_node);
 
-	return 1;
+	return PWRSEQ_MATCH_OK;
 
 err_put_clks:
 	clk_bulk_put(ctx->num_clks, ctx->clks);

-- 
2.48.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2025-06-24 16:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-24 14:32 [PATCH 0/5] pwrseq: replace magic numbers with defines for match() return values Bartosz Golaszewski
2025-06-24 14:32 ` [PATCH 1/5] pwrseq: thead-gpu: add missing header Bartosz Golaszewski
2025-06-24 14:32 ` [PATCH 2/5] pwrseq: extend build coverage for pwrseq drivers with COMPILE_TEST=y Bartosz Golaszewski
2025-06-24 14:32 ` [PATCH 3/5] pwrseq: add defines for return values of the match() callback Bartosz Golaszewski
2025-06-24 14:32 ` [PATCH 4/5] pwrseq: qcom-wcn: use new defines for match() return values Bartosz Golaszewski
2025-06-24 14:32 ` Bartosz Golaszewski [this message]
2025-06-25 10:03 ` [PATCH 0/5] pwrseq: replace magic numbers with " Ulf Hansson
2025-06-30  7:11 ` Bartosz Golaszewski

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=20250624-pwrseq-match-defines-v1-5-a59d90a951f1@linaro.org \
    --to=brgl@bgdev.pl \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=drew@pdp7.com \
    --cc=guoren@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=m.wilczynski@samsung.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wefu@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).