Re: [PATCH 2/5] regulator; tps65090: Register all regulators insingle probe call

From: Mark Brown
Date: Tue Oct 09 2012 - 02:22:45 EST


On Sat, Oct 06, 2012 at 08:47:48PM +0530, Laxman Dewangan wrote:
> MFD drier registers the regulator driver once per device and
> hence it is require to register all regulators in single probe
> call.
> Following are details of changes done to achieve this:
> - Add max regulator and register all regulators even if there
> is no regulator init data from platform.
> - Convert regulator init data to pointer type in platform data.
> - Add input supply name in regulator desc to provide input supply.
> - Separate desc information from driver information.

Shouldn't this be the first commit in the series? Also...

> + for (num = 0; num < TPS65090_REGULATOR_MAX; num++) {
> + tps_pdata = tps65090_pdata->reg_pdata[num];

> struct tps65090_regulator_platform_data {
> - struct regulator_init_data regulator;
> + struct regulator_init_data *reg_init_data;
> };

I can't help but think that if we're going to require the full array
here the array should just be declared immediately - perhaps as an array
of pointers:

struct regulator_init_data *reg_init_data[TPS65090_REGULATOR_MAX];

to allow things to be missed out. Otherwise we're likely to crash if
the user misses a regulator or something.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/