[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151016165023.GT14956@sirena.org.uk>
Date: Fri, 16 Oct 2015 17:50:23 +0100
From: Mark Brown <broonie@...nel.org>
To: Sascha Hauer <s.hauer@...gutronix.de>
Cc: linux-kernel@...r.kernel.org, Liam Girdwood <lgirdwood@...il.com>,
kernel@...gutronix.de, alkml@...gutronix.de
Subject: Re: [PATCH 5/8] regulator: introduce regulator_get_voltage_floor
On Tue, Oct 13, 2015 at 12:45:28PM +0200, Sascha Hauer wrote:
> + num_voltages = regulator_count_voltages(regulator);
> + if (num_voltages < 0)
> + return num_voltages;
> + for (i = 0; i < num_voltages; i++) {
> + now = _regulator_list_voltage(regulator, i, 0);
> + if (now < 0)
> + continue;
> + if (now < best && now >= min_uV)
> + best = now;
> + }
Why is this not a factoring out of existing code (indeed it is itself a
reimplementation of regulator_map_voltage_iterate())? This will also be
a substantial performance loss in cases where we have a known mapping
function - we should use a map_voltage() operation if one exists like we
do in _do_set_voltage(). That has logic to handle missing mapping
functions as a transition measure, now I look at it we should probably
remove that code and just require that the mapping function is set if
appropriate.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists