]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: tegra20: dsi: use regulator_set_enable_if_allowed
authorSvyatoslav Ryhel <clamor95@gmail.com>
Tue, 3 Oct 2023 06:25:34 +0000 (09:25 +0300)
committerAnatolij Gustschin <agust@denx.de>
Sun, 22 Oct 2023 17:28:31 +0000 (19:28 +0200)
With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators and may be further expanded on all
regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
drivers/video/tegra20/tegra-dsi.c

index 8c3404e085dc1d04cef6a08e7f187a36265b253e..b4cf4fad5eb610af971d5a94b2eab38594bb4d82 100644 (file)
@@ -831,11 +831,9 @@ static int tegra_dsi_bridge_probe(struct udevice *dev)
 
        tegra_dsi_get_format(device->format, &priv->format);
 
-       if (priv->avdd) {
-               ret = regulator_set_enable(priv->avdd, true);
-               if (ret)
-                       return ret;
-       }
+       ret = regulator_set_enable_if_allowed(priv->avdd, true);
+       if (ret && ret != -ENOSYS)
+               return ret;
 
        tegra_dsi_init_clocks(dev);