kernel: Add missing devm_regulator_get_exclusive()
[openwrt/staging/wigyori.git] / target / linux / generic / backport-5.10 / 900-regulator-consumer-Add-missing-stubs-to-regulator-co.patch
1 From a71658c7db0b2be9fcab3522aeabe11792a4f481 Mon Sep 17 00:00:00 2001
2 From: Dmitry Osipenko <digetx@gmail.com>
3 Date: Wed, 20 Jan 2021 23:58:44 +0300
4 Subject: [PATCH] regulator: consumer: Add missing stubs to
5 regulator/consumer.h
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 commit 51dfb6ca3728bd0a0a3c23776a12d2a15a1d2457 upstream.
11
12 Add missing stubs to regulator/consumer.h in order to fix COMPILE_TEST
13 of the kernel. In particular this should fix compile-testing of OPP core
14 because of a missing stub for regulator_sync_voltage().
15
16 Reported-by: kernel test robot <lkp@intel.com>
17 Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
18 Link: https://lore.kernel.org/r/20210120205844.12658-1-digetx@gmail.com
19 Signed-off-by: Mark Brown <broonie@kernel.org>
20 Cc: Bjørn Mork <bjorn@mork.no>
21 Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23 ---
24 include/linux/regulator/consumer.h | 30 ++++++++++++++++++++++++++++++
25 1 file changed, 30 insertions(+)
26
27 --- a/include/linux/regulator/consumer.h
28 +++ b/include/linux/regulator/consumer.h
29 @@ -332,6 +332,12 @@ regulator_get_exclusive(struct device *d
30 }
31
32 static inline struct regulator *__must_check
33 +devm_regulator_get_exclusive(struct device *dev, const char *id)
34 +{
35 + return ERR_PTR(-ENODEV);
36 +}
37 +
38 +static inline struct regulator *__must_check
39 regulator_get_optional(struct device *dev, const char *id)
40 {
41 return ERR_PTR(-ENODEV);
42 @@ -486,6 +492,11 @@ static inline int regulator_get_voltage(
43 return -EINVAL;
44 }
45
46 +static inline int regulator_sync_voltage(struct regulator *regulator)
47 +{
48 + return -EINVAL;
49 +}
50 +
51 static inline int regulator_is_supported_voltage(struct regulator *regulator,
52 int min_uV, int max_uV)
53 {
54 @@ -578,6 +589,25 @@ static inline int devm_regulator_unregis
55 return 0;
56 }
57
58 +static inline int regulator_suspend_enable(struct regulator_dev *rdev,
59 + suspend_state_t state)
60 +{
61 + return -EINVAL;
62 +}
63 +
64 +static inline int regulator_suspend_disable(struct regulator_dev *rdev,
65 + suspend_state_t state)
66 +{
67 + return -EINVAL;
68 +}
69 +
70 +static inline int regulator_set_suspend_voltage(struct regulator *regulator,
71 + int min_uV, int max_uV,
72 + suspend_state_t state)
73 +{
74 + return -EINVAL;
75 +}
76 +
77 static inline void *regulator_get_drvdata(struct regulator *regulator)
78 {
79 return NULL;