@@ -168,29 +168,6 @@ int devm_regulator_get_enable_read_voltage(struct device *dev, const char *id);
168168void regulator_put (struct regulator * regulator );
169169void devm_regulator_put (struct regulator * regulator );
170170
171- #if IS_ENABLED (CONFIG_OF )
172- struct regulator * __must_check of_regulator_get_optional (struct device * dev ,
173- struct device_node * node ,
174- const char * id );
175- struct regulator * __must_check devm_of_regulator_get_optional (struct device * dev ,
176- struct device_node * node ,
177- const char * id );
178- #else
179- static inline struct regulator * __must_check of_regulator_get_optional (struct device * dev ,
180- struct device_node * node ,
181- const char * id )
182- {
183- return ERR_PTR (- ENODEV );
184- }
185-
186- static inline struct regulator * __must_check devm_of_regulator_get_optional (struct device * dev ,
187- struct device_node * node ,
188- const char * id )
189- {
190- return ERR_PTR (- ENODEV );
191- }
192- #endif
193-
194171int regulator_register_supply_alias (struct device * dev , const char * id ,
195172 struct device * alias_dev ,
196173 const char * alias_id );
@@ -223,8 +200,6 @@ int regulator_disable_deferred(struct regulator *regulator, int ms);
223200
224201int __must_check regulator_bulk_get (struct device * dev , int num_consumers ,
225202 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 );
228203int __must_check devm_regulator_bulk_get (struct device * dev , int num_consumers ,
229204 struct regulator_bulk_data * consumers );
230205void devm_regulator_bulk_put (struct regulator_bulk_data * consumers );
@@ -373,20 +348,6 @@ devm_regulator_get_optional(struct device *dev, const char *id)
373348 return ERR_PTR (- ENODEV );
374349}
375350
376- static inline struct regulator * __must_check of_regulator_get_optional (struct device * dev ,
377- struct device_node * node ,
378- const char * id )
379- {
380- return ERR_PTR (- ENODEV );
381- }
382-
383- static inline struct regulator * __must_check devm_of_regulator_get_optional (struct device * dev ,
384- struct device_node * node ,
385- const char * id )
386- {
387- return ERR_PTR (- ENODEV );
388- }
389-
390351static inline void regulator_put (struct regulator * regulator )
391352{
392353}
@@ -483,12 +444,6 @@ static inline int devm_regulator_bulk_get(struct device *dev, int num_consumers,
483444 return 0 ;
484445}
485446
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-
492447static inline int devm_regulator_bulk_get_const (
493448 struct device * dev , int num_consumers ,
494449 const struct regulator_bulk_data * in_consumers ,
@@ -700,6 +655,38 @@ regulator_is_equal(struct regulator *reg1, struct regulator *reg2)
700655}
701656#endif
702657
658+ #if IS_ENABLED (CONFIG_OF ) && IS_ENABLED (CONFIG_REGULATOR )
659+ struct regulator * __must_check of_regulator_get_optional (struct device * dev ,
660+ struct device_node * node ,
661+ const char * id );
662+ struct regulator * __must_check devm_of_regulator_get_optional (struct device * dev ,
663+ struct device_node * node ,
664+ const char * id );
665+ int __must_check of_regulator_bulk_get_all (struct device * dev , struct device_node * np ,
666+ struct regulator_bulk_data * * consumers );
667+ #else
668+ static inline struct regulator * __must_check of_regulator_get_optional (struct device * dev ,
669+ struct device_node * node ,
670+ const char * id )
671+ {
672+ return ERR_PTR (- ENODEV );
673+ }
674+
675+ static inline struct regulator * __must_check devm_of_regulator_get_optional (struct device * dev ,
676+ struct device_node * node ,
677+ const char * id )
678+ {
679+ return ERR_PTR (- ENODEV );
680+ }
681+
682+ static inline int of_regulator_bulk_get_all (struct device * dev , struct device_node * np ,
683+ struct regulator_bulk_data * * consumers )
684+ {
685+ return 0 ;
686+ }
687+
688+ #endif
689+
703690static inline int regulator_set_voltage_triplet (struct regulator * regulator ,
704691 int min_uV , int target_uV ,
705692 int max_uV )
0 commit comments