On Sun, 6 Jan 2019 at 23:13, Lokesh Vutla <lokeshvu...@ti.com> wrote: > > regulator_set_enable() api throws an error in the following three cases: > - when requested to disable an always-on regulator > - when set_enable() ops not provided by regulator driver > - when enabling is actually failed.(Error returned by the regulator driver) > > Sometimes consumer drivers doesn't want to track the first two scenarios > and just need to worry about the case where enabling is actually failed. > But it is also a good practice to have an error value returned in the > first two cases. > > So introduce an api regulator_set_enable_if_allowed() which ignores the > first two error cases and returns an error as given by regulator driver. > Consumer drivers can use this api need not worry about the first two > error conditions. > > Signed-off-by: Lokesh Vutla <lokeshvu...@ti.com> > --- > drivers/power/regulator/regulator-uclass.c | 11 +++++++++++ > include/power/regulator.h | 11 +++++++++++ > 2 files changed, 22 insertions(+)
Thanks for the patch. But please do adjust the tests to call this function and check that it does the right thing. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot