Add regulator_is_equal() helper to compare whether two regulators are the same. This is useful for checking whether two separate regulators in a driver are actually the same supply.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -287,6 +287,8 @@ void regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers, · 286 unmodified lines | ||
| 287 | 287 | const char *const *supply_names, |
| 288 | 288 | unsigned int num_supplies); |
| 289 | 289 | |
| 290 | +bool regulator_is_equal(struct regulator *reg1, struct regulator *reg2); | |
| 291 | + | |
| 290 | 292 | #else |
| 291 | 293 | |
| 292 | 294 | /* |
| @@ -593,6 +595,11 @@ regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers, · 300 unmodified lines | ||
| 593 | 595 | { |
| 594 | 596 | } |
| 595 | 597 | |
| 598 | +static inline bool | |
| 599 | +regulator_is_equal(struct regulator *reg1, struct regulator *reg2); | |
| 600 | +{ | |
| 601 | + return false; | |
| 602 | +} | |
| 596 | 603 | #endif |
| 597 | 604 | |
| 598 | 605 | static inline int regulator_set_voltage_triplet(struct regulator *regulator, |