Skip to content

Commit 1156b5e

Browse files
Mani-Sadhasivambroonie
authored andcommitted
regulator: Guard of_regulator_bulk_get_all() with CONFIG_OF
Since the definition is in drivers/regulator/of_regulator.c and compiled only if CONFIG_OF is enabled, building the consumer driver without CONFIG_OF and with CONFIG_REGULATOR will result in below build error: ERROR: modpost: "of_regulator_bulk_get_all" [drivers/pci/pwrctrl/pci-pwrctl-slot.ko] undefined! Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 27b9ecc ("regulator: Add of_regulator_bulk_get_all") Signed-off-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 1322149 commit 1156b5e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

include/linux/regulator/consumer.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ struct regulator *__must_check of_regulator_get_optional(struct device *dev,
175175
struct regulator *__must_check devm_of_regulator_get_optional(struct device *dev,
176176
struct device_node *node,
177177
const char *id);
178+
int __must_check of_regulator_bulk_get_all(struct device *dev, struct device_node *np,
179+
struct regulator_bulk_data **consumers);
178180
#else
179181
static inline struct regulator *__must_check of_regulator_get_optional(struct device *dev,
180182
struct device_node *node,
@@ -189,6 +191,13 @@ static inline struct regulator *__must_check devm_of_regulator_get_optional(stru
189191
{
190192
return ERR_PTR(-ENODEV);
191193
}
194+
195+
static inline int of_regulator_bulk_get_all(struct device *dev, struct device_node *np,
196+
struct regulator_bulk_data **consumers)
197+
{
198+
return 0;
199+
}
200+
192201
#endif
193202

194203
int regulator_register_supply_alias(struct device *dev, const char *id,
@@ -223,8 +232,6 @@ int regulator_disable_deferred(struct regulator *regulator, int ms);
223232

224233
int __must_check regulator_bulk_get(struct device *dev, int num_consumers,
225234
struct regulator_bulk_data *consumers);
226-
int __must_check of_regulator_bulk_get_all(struct device *dev, struct device_node *np,
227-
struct regulator_bulk_data **consumers);
228235
int __must_check devm_regulator_bulk_get(struct device *dev, int num_consumers,
229236
struct regulator_bulk_data *consumers);
230237
void devm_regulator_bulk_put(struct regulator_bulk_data *consumers);
@@ -483,12 +490,6 @@ static inline int devm_regulator_bulk_get(struct device *dev, int num_consumers,
483490
return 0;
484491
}
485492

486-
static inline int of_regulator_bulk_get_all(struct device *dev, struct device_node *np,
487-
struct regulator_bulk_data **consumers)
488-
{
489-
return 0;
490-
}
491-
492493
static inline int devm_regulator_bulk_get_const(
493494
struct device *dev, int num_consumers,
494495
const struct regulator_bulk_data *in_consumers,

0 commit comments

Comments
 (0)