There are many regulator consumers who - before using the regulator bulk functions - set the supply names in regulator_bulk_data using a for loop. Let's provide a simple helper in the consumer API that allows users to do the same with a single function call.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -281,6 +281,12 @@ void devm_regulator_unregister_notifier(struct regulator *regulator, · 280 unmodified lines | |||
| 281 | void *regulator_get_drvdata(struct regulator *regulator); | 281 | void *regulator_get_drvdata(struct regulator *regulator); |
| 282 | void regulator_set_drvdata(struct regulator *regulator, void *data); | 282 | void regulator_set_drvdata(struct regulator *regulator, void *data); |
| 283 | 283 | ||
| 284 | /* misc helpers */ | ||
| 285 | |||
| 286 | void regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers, | ||
| 287 | const char *const *supply_names, | ||
| 288 | unsigned int num_supplies); | ||
| 289 | |||
| 284 | #else | 290 | #else |
| 285 | 291 | ||
| 286 | /* | 292 | /* |
| @@ -580,6 +586,12 @@ static inline int regulator_list_voltage(struct regulator *regulator, unsigned s · 293 unmodified lines | |||
| 580 | return -EINVAL; | 586 | return -EINVAL; |
| 581 | } | 587 | } |
| 582 | 588 | ||
| 589 | void regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers, | ||
| 590 | const char *const *supply_names, | ||
| 591 | unsigned int num_supplies) | ||
| 592 | { | ||
| 593 | } | ||
| 594 | |||
| 583 | #endif | 595 | #endif |
| 584 | 596 | ||
| 585 | static inline int regulator_set_voltage_triplet(struct regulator *regulator, | 597 | static inline int regulator_set_voltage_triplet(struct regulator *regulator, |