diff options
| author | Svyatoslav Ryhel <clamor95@gmail.com> | 2023-10-03 09:25:33 +0300 |
|---|---|---|
| committer | Anatolij Gustschin <agust@denx.de> | 2023-10-22 19:25:10 +0200 |
| commit | 66ac14f7ef974e5d9404ff9b354590554e405409 (patch) | |
| tree | 9151095253f7931995309a5651076593f06b6cb4 /drivers | |
| parent | 251ff3493233a8fddd4468ff341d63d592b608d4 (diff) | |
video: simple_panel: use regulator_set_enable_if_allowed
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>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/video/simple_panel.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c index 6a6473eb0e5..efb122b534a 100644 --- a/drivers/video/simple_panel.c +++ b/drivers/video/simple_panel.c @@ -114,11 +114,11 @@ static int simple_panel_probe(struct udevice *dev) const u32 dsi_data = dev_get_driver_data(dev); int ret; - if (CONFIG_IS_ENABLED(DM_REGULATOR) && priv->reg) { - debug("%s: Enable regulator '%s'\n", __func__, priv->reg->name); - ret = regulator_set_enable(priv->reg, true); - if (ret) - return ret; + ret = regulator_set_enable_if_allowed(priv->reg, true); + if (ret && ret != -ENOSYS) { + debug("%s: failed to enable regulator '%s' %d\n", + __func__, priv->reg->name, ret); + return ret; } switch (dsi_data) { |
