b7952b8484c18375513ed3b4c5f528deeed03be1
[openwrt/staging/hauke.git] / target / linux / sunxi / patches-3.13 / 126-regulator-dont-print-error-when-no-regulator-found.patch
1 From 820a121fdef79cc1293e6fee2fbe8156d9e8a75a Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
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
7 Only print an error when _regulator_get() is expected to return a valid
8 regulator, that is when _regulator_get() is called from regulator_get() and
9 we're not using the dummy because we don't have full-constraints, or when
10 _regulator_get() is called from regulator_get_exclusive() in which case
11 returning a dummy is not allowed.
12
13 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 ---
15 drivers/regulator/core.c | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18 diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
19 index d85f313..9888f26 100644
20 --- a/drivers/regulator/core.c
21 +++ b/drivers/regulator/core.c
22 @@ -1351,7 +1351,8 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
23
24 rdev = dummy_regulator_rdev;
25 goto found;
26 - } else {
27 + /* Don't log an error when called from regulator_get_optional() */
28 + } else if (!have_full_constraints() || exclusive) {
29 dev_err(dev, "dummy supplies not allowed\n");
30 }
31
32 --
33 1.8.5.1
34