diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-06-24 16:32:22 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-06-30 09:07:41 +0200 |
commit | 385b735c90ae44dbde65fab76e356a96ff8f67be (patch) | |
tree | 448d14d8d1ddd0f3157a592a93eb7613a183a10e | |
parent | f698155029efc708349126c8944fa8c95b28098c (diff) |
power: sequencing: thead-gpu: use new defines for match() return values
Replace the magic numbers with proper defines we now have in the header.
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20250624-pwrseq-match-defines-v1-5-a59d90a951f1@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-rw-r--r-- | drivers/power/sequencing/pwrseq-thead-gpu.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/power/sequencing/pwrseq-thead-gpu.c b/drivers/power/sequencing/pwrseq-thead-gpu.c index 855c6cc4f3b5..7c82a10ca9f6 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); |