@@ -168,29 +168,6 @@ int devm_regulator_get_enable_read_voltage(struct device *dev, const char *id);
168
168
void regulator_put (struct regulator * regulator );
169
169
void devm_regulator_put (struct regulator * regulator );
170
170
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
-
194
171
int regulator_register_supply_alias (struct device * dev , const char * id ,
195
172
struct device * alias_dev ,
196
173
const char * alias_id );
@@ -223,8 +200,6 @@ int regulator_disable_deferred(struct regulator *regulator, int ms);
223
200
224
201
int __must_check regulator_bulk_get (struct device * dev , int num_consumers ,
225
202
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 );
228
203
int __must_check devm_regulator_bulk_get (struct device * dev , int num_consumers ,
229
204
struct regulator_bulk_data * consumers );
230
205
void devm_regulator_bulk_put (struct regulator_bulk_data * consumers );
@@ -373,20 +348,6 @@ devm_regulator_get_optional(struct device *dev, const char *id)
373
348
return ERR_PTR (- ENODEV );
374
349
}
375
350
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
-
390
351
static inline void regulator_put (struct regulator * regulator )
391
352
{
392
353
}
@@ -483,12 +444,6 @@ static inline int devm_regulator_bulk_get(struct device *dev, int num_consumers,
483
444
return 0 ;
484
445
}
485
446
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
-
492
447
static inline int devm_regulator_bulk_get_const (
493
448
struct device * dev , int num_consumers ,
494
449
const struct regulator_bulk_data * in_consumers ,
@@ -700,6 +655,38 @@ regulator_is_equal(struct regulator *reg1, struct regulator *reg2)
700
655
}
701
656
#endif
702
657
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
+
703
690
static inline int regulator_set_voltage_triplet (struct regulator * regulator ,
704
691
int min_uV , int target_uV ,
705
692
int max_uV )
0 commit comments