2
0

126-regulator-dont-print-error-when-no-regulator-found.patch 1.0 KB

1234567891011121314151617181920212223242526272829
  1. From 820a121fdef79cc1293e6fee2fbe8156d9e8a75a Mon Sep 17 00:00:00 2001
  2. From: Hans de Goede <[email protected]>
  3. Date: Wed, 11 Dec 2013 15:07:52 +0100
  4. Subject: [PATCH] regulator_get_optional: don't print an error when no
  5. regulator is found
  6. Only print an error when _regulator_get() is expected to return a valid
  7. regulator, that is when _regulator_get() is called from regulator_get() and
  8. we're not using the dummy because we don't have full-constraints, or when
  9. _regulator_get() is called from regulator_get_exclusive() in which case
  10. returning a dummy is not allowed.
  11. Signed-off-by: Hans de Goede <[email protected]>
  12. ---
  13. drivers/regulator/core.c | 3 ++-
  14. 1 file changed, 2 insertions(+), 1 deletion(-)
  15. --- a/drivers/regulator/core.c
  16. +++ b/drivers/regulator/core.c
  17. @@ -1351,7 +1351,8 @@ static struct regulator *_regulator_get(
  18. rdev = dummy_regulator_rdev;
  19. goto found;
  20. - } else {
  21. + /* Don't log an error when called from regulator_get_optional() */
  22. + } else if (!have_full_constraints() || exclusive) {
  23. dev_err(dev, "dummy supplies not allowed\n");
  24. }