0004-HACK-regulator-Don-t-error-on-reentrant-regulator-ac.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 2ab104621dc97a89bc8f75e3b5903b83e793baf8 Mon Sep 17 00:00:00 2001
  2. From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
  3. Date: Sat, 19 Aug 2023 16:43:58 +0300
  4. Subject: [PATCH] HACK: regulator: Don't error on reentrant regulator actions
  5. Commit 4fcba5d556b42 ("regulator: implement basic reference counter")
  6. implements reference counting for regulator enable/disable actions, but
  7. does not update its callers to handle the error cases it adds. This
  8. breaks gru-kevin, report enabling the regulator as a success as a
  9. workaround. It would be better to fix the callers but that needs more
  10. debugging.
  11. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
  12. ---
  13. drivers/power/regulator/regulator_common.c | 4 ++--
  14. 1 file changed, 2 insertions(+), 2 deletions(-)
  15. diff --git a/drivers/power/regulator/regulator_common.c b/drivers/power/regulator/regulator_common.c
  16. index e26f5ebec347..1c2dfdf9b19d 100644
  17. --- a/drivers/power/regulator/regulator_common.c
  18. +++ b/drivers/power/regulator/regulator_common.c
  19. @@ -75,7 +75,7 @@ int regulator_common_set_enable(const struct udevice *dev,
  20. /* If previously enabled, increase count */
  21. if (enable && plat->enable_count > 0) {
  22. plat->enable_count++;
  23. - return -EALREADY;
  24. + return 0;
  25. }
  26. if (!enable) {
  27. @@ -85,7 +85,7 @@ int regulator_common_set_enable(const struct udevice *dev,
  28. return -EBUSY;
  29. } else if (!plat->enable_count) {
  30. /* If already disabled, do nothing */
  31. - return -EALREADY;
  32. + return 0;
  33. }
  34. }
  35. --
  36. 2.42.0