Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1251633 > unrolled thread

Re: [PATCH 5/8] regulator: introduce regulator_get_voltage_floor

Started bySascha Hauer <s.hauer@pengutronix.de>
First post2015-10-20 14:30 +0200
Last post2015-10-20 14:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 5/8] regulator: introduce regulator_get_voltage_floor Sascha Hauer <s.hauer@pengutronix.de> - 2015-10-20 14:30 +0200

#1251633 — Re: [PATCH 5/8] regulator: introduce regulator_get_voltage_floor

FromSascha Hauer <s.hauer@pengutronix.de>
Date2015-10-20 14:30 +0200
SubjectRe: [PATCH 5/8] regulator: introduce regulator_get_voltage_floor
Message-ID<qlEdc-3CF-9@gated-at.bofh.it>
On Fri, Oct 16, 2015 at 05:50:23PM +0100, Mark Brown wrote:
> 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.

I didn't realize the map_voltage functionality is exactly what I want to
have. Turns out that I can factor out a regulator_map_voltage() function
instead of creating a regulator_get_voltage_floor() function. Updated
series follows shortly.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web