clk: qcom: gdsc: add missing error handling
authorJohan Hovold <johan+linaro@kernel.org>
Thu, 29 Sep 2022 15:58:16 +0000 (17:58 +0200)
committerBjorn Andersson <andersson@kernel.org>
Thu, 29 Sep 2022 16:34:46 +0000 (11:34 -0500)
commiteab4c1ebdd657957bf7ae66ffb8849b462db78b3
treec2503ae7f3c57dc5114f643333b10e59e7789510
parent6632a6adae86265ca79cefc0e48e4a672a1108df
clk: qcom: gdsc: add missing error handling

Since commit 7eb231c337e0 ("PM / Domains: Convert pm_genpd_init() to
return an error code") pm_genpd_init() can return an error which the
caller must handle.

The current error handling was also incomplete as the runtime PM and
regulator use counts were not balanced in all error paths.

Add the missing error handling to the GDSC initialisation to avoid
continuing as if nothing happened on errors.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220929155816.17425-1-johan+linaro@kernel.org
drivers/clk/qcom/gdsc.c