[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <578d2348-9a17-410e-b7c8-772c0d82c10f@sirena.org.uk>
Date: Wed, 30 Oct 2024 17:03:06 +0000
From: Mark Brown <broonie@...nel.org>
To: Kory Maincent <kory.maincent@...tlin.com>
Cc: Andrew Lunn <andrew@...n.ch>, Oleksij Rempel <o.rempel@...gutronix.de>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Jonathan Corbet <corbet@....net>,
Donald Hunter <donald.hunter@...il.com>,
Rob Herring <robh@...nel.org>, Andrew Lunn <andrew+netdev@...n.ch>,
Simon Horman <horms@...nel.org>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Liam Girdwood <lgirdwood@...il.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux-doc@...r.kernel.org, Kyle Swenson <kyle.swenson@....tech>,
Dent Project <dentproject@...uxfoundation.org>,
kernel@...gutronix.de,
Maxime Chevallier <maxime.chevallier@...tlin.com>
Subject: Re: [PATCH RFC net-next v2 11/18] regulator: Add support for power
budget description
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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists