[PATCH] regulator: Handle deferred clk

Christophe JAILLET posted 1 patch 1 year, 1 month ago
drivers/regulator/fixed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] regulator: Handle deferred clk
Posted by Christophe JAILLET 1 year, 1 month ago
devm_clk_get() can return -EPROBE_DEFER. So it is better to return the
error code from devm_clk_get(), instead of a hard coded -ENOENT.

This gives more opportunities to successfully probe the driver.

Fixes: 8959e5324485 ("regulator: fixed: add possibility to enable by clock")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/regulator/fixed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index e3436f49dea4..364d1a2683b7 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -215,7 +215,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
 		drvdata->enable_clock = devm_clk_get(dev, NULL);
 		if (IS_ERR(drvdata->enable_clock)) {
 			dev_err(dev, "Can't get enable-clock from devicetree\n");
-			return -ENOENT;
+			return PTR_ERR(drvdata->enable_clock);
 		}
 	} else if (drvtype && drvtype->has_performance_state) {
 		drvdata->desc.ops = &fixed_voltage_domain_ops;
-- 
2.34.1
Re: [PATCH] regulator: Handle deferred clk
Posted by Mark Brown 1 year, 1 month ago
On Sun, 26 Mar 2023 10:29:33 +0200, Christophe JAILLET wrote:
> devm_clk_get() can return -EPROBE_DEFER. So it is better to return the
> error code from devm_clk_get(), instead of a hard coded -ENOENT.
> 
> This gives more opportunities to successfully probe the driver.
> 
> 

Applied to

   broonie/regulator.git for-next

Thanks!

[1/1] regulator: Handle deferred clk
      commit: 02bcba0b9f9da706d5bd1e8cbeb83493863e17b5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark