On Wed, Oct 30, 2024 at 05:53:13PM +0100, Kory Maincent wrote: > +/** > + * regulator_get_power_budget - get regulator total power budget > + * @regulator: regulator source > + * > + * Return: Power budget of the regulator in mW. > + */ > +int regulator_get_power_budget(struct regulator *regulator) > +{ > + return regulator->rdev->constraints->pw_budget; > +} This is going to go badly with multiple consumers... > +static inline int regulator_get_power_budget(struct regulator *regulator) > +{ > + return 0; > +} We should probably default to INT_MAX here and in the case where we do have support, that way consumers will fail gracefully when no budget is specified.
Attachment:
signature.asc
Description: PGP signature