diff mbox series

[v2] video: meson: dw-hdmi: do not fail probe if HDMI regulator is already enabled

Message ID 20241009-u-boot-video-fix-hdmi-supply-already-on-v2-1-4478a28d1f49@linaro.org
State Accepted
Commit 8c914e53641e22a7fe5877c816085e1b3192b95b
Headers show
Series [v2] video: meson: dw-hdmi: do not fail probe if HDMI regulator is already enabled | expand

Commit Message

Neil Armstrong Oct. 9, 2024, 8:01 a.m. UTC
If the regulator is already enabled, this happens if the regulator
is set in regulator-always-on, regulator_set_enable() return -EALREADY.

Ignore the -EALREADY return since it's not an error.

Suggested-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v2:
- Switch to regulator_set_enable_if_allowed thanks to Jonas's suggestion
- Link to v1: https://lore.kernel.org/r/20241008-u-boot-video-fix-hdmi-supply-already-on-v1-1-3a12c73ff3f1@linaro.org
---
 drivers/video/meson/meson_dw_hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


---
base-commit: 28dc47038edc4e93f32d75a357131bcf01a18d85
change-id: 20241008-u-boot-video-fix-hdmi-supply-already-on-e6a9af27b1eb

Best regards,

Comments

Neil Armstrong Oct. 11, 2024, 2:42 p.m. UTC | #1
Hi,

On Wed, 09 Oct 2024 10:01:56 +0200, Neil Armstrong wrote:
> If the regulator is already enabled, this happens if the regulator
> is set in regulator-always-on, regulator_set_enable() return -EALREADY.
> 
> Ignore the -EALREADY return since it's not an error.
> 
> 

Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-amlogic (u-boot-amlogic-next)

[1/1] video: meson: dw-hdmi: do not fail probe if HDMI regulator is already enabled
      https://source.denx.de/u-boot/custodians/u-boot-amlogic/-/commit/9c472742f5c25fd4098e034a7f292cc4e26bd25d
diff mbox series

Patch

diff --git a/drivers/video/meson/meson_dw_hdmi.c b/drivers/video/meson/meson_dw_hdmi.c
index 587df7beb9b..1631dc38416 100644
--- a/drivers/video/meson/meson_dw_hdmi.c
+++ b/drivers/video/meson/meson_dw_hdmi.c
@@ -418,8 +418,8 @@  static int meson_dw_hdmi_probe(struct udevice *dev)
 	}
 
 	if (!ret) {
-		ret = regulator_set_enable(supply, true);
-		if (ret)
+		ret = regulator_set_enable_if_allowed(supply, true);
+		if (ret && ret != -ENOSYS)
 			return ret;
 	}
 #endif