Skip to content

Commit 6677196

Browse files
jhovoldandersson
authored andcommitted
clk: qcom: gdsc: treat optional supplies as optional
Since commit deebc79 ("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc") the GDSC supply must be treated as optional to avoid warnings like: gpu_cc-sc8280xp 3d90000.clock-controller: supply vdd-gfx not found, using dummy regulator on SC8280XP. Fortunately, the driver is already prepared to handle this by checking that the regulator pointer is non-NULL before use. This also avoids triggering a potential deadlock on SC8280XP even if the underlying issue still remains for the derivative platforms like SA8295P that actually use the supply. Fixes: deebc79 ("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc") Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Johan Hovold <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 4cece76 commit 6677196

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/clk/qcom/gdsc.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,14 @@ int gdsc_register(struct gdsc_desc *desc,
487487
if (!scs[i] || !scs[i]->supply)
488488
continue;
489489

490-
scs[i]->rsupply = devm_regulator_get(dev, scs[i]->supply);
491-
if (IS_ERR(scs[i]->rsupply))
492-
return PTR_ERR(scs[i]->rsupply);
490+
scs[i]->rsupply = devm_regulator_get_optional(dev, scs[i]->supply);
491+
if (IS_ERR(scs[i]->rsupply)) {
492+
ret = PTR_ERR(scs[i]->rsupply);
493+
if (ret != -ENODEV)
494+
return ret;
495+
496+
scs[i]->rsupply = NULL;
497+
}
493498
}
494499

495500
data->num_domains = num;

0 commit comments

Comments
 (0)