diff options
author | Johan Hovold <johan+linaro@kernel.org> | 2024-03-25 09:58:35 +0100 |
---|---|---|
committer | Bjorn Andersson <andersson@kernel.org> | 2024-04-02 22:47:07 -0500 |
commit | 6677196fb1932e60b88ad0794a7ae532df178654 (patch) | |
tree | d63fe78a3b285e9866408c44d6eb3abb8be124df /drivers | |
parent | 4cece764965020c22cff7665b18a012006359095 (diff) | |
download | linux-stable-6677196fb1932e60b88ad0794a7ae532df178654.tar.gz linux-stable-6677196fb1932e60b88ad0794a7ae532df178654.tar.bz2 linux-stable-6677196fb1932e60b88ad0794a7ae532df178654.zip |
clk: qcom: gdsc: treat optional supplies as optional
Since commit deebc79b28d6 ("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: deebc79b28d6 ("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc")
Link: https://lore.kernel.org/lkml/Zf25Sv2x9WaCFuIH@hovoldconsulting.com/
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20240325085835.26158-1-johan+linaro@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/qcom/gdsc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c index e7a4068b9f39..df9618ab7eea 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -487,9 +487,14 @@ int gdsc_register(struct gdsc_desc *desc, if (!scs[i] || !scs[i]->supply) continue; - scs[i]->rsupply = devm_regulator_get(dev, scs[i]->supply); - if (IS_ERR(scs[i]->rsupply)) - return PTR_ERR(scs[i]->rsupply); + scs[i]->rsupply = devm_regulator_get_optional(dev, scs[i]->supply); + if (IS_ERR(scs[i]->rsupply)) { + ret = PTR_ERR(scs[i]->rsupply); + if (ret != -ENODEV) + return ret; + + scs[i]->rsupply = NULL; + } } data->num_domains = num; |