Skip to content

Commit 385b735

Browse files
author
Bartosz Golaszewski
committed
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent f698155 commit 385b735

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/power/sequencing/pwrseq-thead-gpu.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,24 +124,25 @@ static int pwrseq_thead_gpu_match(struct pwrseq_device *pwrseq,
124124

125125
/* We only match the specific T-HEAD TH1520 GPU compatible */
126126
if (!of_device_is_compatible(dev->of_node, "thead,th1520-gpu"))
127-
return 0;
127+
return PWRSEQ_NO_MATCH;
128128

129129
ret = of_parse_phandle_with_args(dev->of_node, "power-domains",
130130
"#power-domain-cells", 0, &pwr_spec);
131131
if (ret)
132-
return 0;
132+
return PWRSEQ_NO_MATCH;
133133

134134
/* Additionally verify consumer device has AON as power-domain */
135135
if (pwr_spec.np != ctx->aon_node || pwr_spec.args[0] != TH1520_GPU_PD) {
136136
of_node_put(pwr_spec.np);
137-
return 0;
137+
return PWRSEQ_NO_MATCH;
138138
}
139139

140140
of_node_put(pwr_spec.np);
141141

142142
/* If a consumer is already bound, only allow a re-match from it */
143143
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;
145146

146147
ctx->num_clks = ARRAY_SIZE(clk_names);
147148
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,
163164

164165
ctx->consumer_node = of_node_get(dev->of_node);
165166

166-
return 1;
167+
return PWRSEQ_MATCH_OK;
167168

168169
err_put_clks:
169170
clk_bulk_put(ctx->num_clks, ctx->clks);

0 commit comments

Comments
 (0)