Re: [PATCH V2 3/3] regulator: add MAX8907 driver

From: Mark Brown
Date: Thu Aug 09 2012 - 07:04:26 EST


On Wed, Aug 08, 2012 at 03:18:47PM -0600, Stephen Warren wrote:

> +static struct regulator_desc max8907_regulators[] = {
> + REG_MBATT(),
> + REG_LDO(SD1, "in-v1", MAX8907_REG_SDCTL1, 650000, 2225000, 25000),

> +#define MATCH(_name, _id) \
> + { \
> + .name = #_name, \
> + .driver_data = (void *)&max8907_regulators[MAX8907_##_id], \

If you're going to be doing this you should be doing:

[MAX8907_##_id] = REG_MBATT()

and so on above to make sure the arrays agree with each other (this is
the same problem as we have with enums in ASoC drivers).

Otherwise this looks good.
--
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/