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: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
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;
}