Skip to content
Snippets Groups Projects
Commit 8202bc29 authored by Eugen Hristev's avatar Eugen Hristev Committed by Jaehoon Chung
Browse files

regulator: handle different error codes in regulator_set_enable_if_allowed


The regulator core can return different codes which are not considered
a real error for this function.
Return success in such cases.

Signed-off-by: default avatarEugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
Reviewed-by: Patrice Chotard's avatarPatrice Chotard <patrice.chotard@foss.st.com>
parent 29fca9f2
No related branches found
No related tags found
No related merge requests found
......@@ -197,6 +197,12 @@ int regulator_set_enable_if_allowed(struct udevice *dev, bool enable)
ret = regulator_set_enable(dev, enable);
if (ret == -ENOSYS || ret == -EACCES)
return 0;
/* if we want to disable but it's in use by someone else */
if (!enable && ret == -EBUSY)
return 0;
/* if it's already enabled/disabled */
if (ret == -EALREADY)
return 0;
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment