Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+6 -5
+6 -5
drivers/power/sequencing/pwrseq-thead-gpu.c
··· 124 124 125 125 /* We only match the specific T-HEAD TH1520 GPU compatible */ 126 126 if (!of_device_is_compatible(dev->of_node, "thead,th1520-gpu")) 127 - return 0; 127 + return PWRSEQ_NO_MATCH; 128 128 129 129 ret = of_parse_phandle_with_args(dev->of_node, "power-domains", 130 130 "#power-domain-cells", 0, &pwr_spec); 131 131 if (ret) 132 - return 0; 132 + return PWRSEQ_NO_MATCH; 133 133 134 134 /* Additionally verify consumer device has AON as power-domain */ 135 135 if (pwr_spec.np != ctx->aon_node || pwr_spec.args[0] != TH1520_GPU_PD) { 136 136 of_node_put(pwr_spec.np); 137 - return 0; 137 + return PWRSEQ_NO_MATCH; 138 138 } 139 139 140 140 of_node_put(pwr_spec.np); 141 141 142 142 /* If a consumer is already bound, only allow a re-match from it */ 143 143 if (ctx->consumer_node) 144 - return ctx->consumer_node == dev->of_node ? 1 : 0; 144 + return ctx->consumer_node == dev->of_node ? 145 + PWRSEQ_MATCH_OK : PWRSEQ_NO_MATCH; 145 146 146 147 ctx->num_clks = ARRAY_SIZE(clk_names); 147 148 ctx->clks = kcalloc(ctx->num_clks, sizeof(*ctx->clks), GFP_KERNEL); ··· 164 163 165 164 ctx->consumer_node = of_node_get(dev->of_node); 166 165 167 - return 1; 166 + return PWRSEQ_MATCH_OK; 168 167 169 168 err_put_clks: 170 169 clk_bulk_put(ctx->num_clks, ctx->clks);