]> git.baikalelectronics.ru Git - kernel.git/commitdiff
regulator: Handle deferred clk
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 26 Mar 2023 08:29:33 +0000 (10:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Apr 2023 09:16:44 +0000 (11:16 +0200)
[ Upstream commit 02bcba0b9f9da706d5bd1e8cbeb83493863e17b5 ]

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: ec662ba089da ("regulator: fixed: add possibility to enable by clock")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/18459fae3d017a66313699c7c8456b28158b2dd0.1679819354.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/fixed.c

index 145402cc9ef2616360ba1230d6135ee9641bd522..2f0bed86467f980ea6a648e166decaf31f1c3dbb 100644 (file)
@@ -182,7 +182,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 {
                drvdata->desc.ops = &fixed_voltage_ops;