[PATCHv3] support PMIC mc13892

Arnaud Patard (Rtp) arnaud.patard at rtp-net.org
Wed Dec 8 09:26:16 EST 2010


Mark Brown <broonie at opensource.wolfsonmicro.com> writes:

> On Wed, Dec 08, 2010 at 10:12:26AM +0100, Uwe Kleine-König wrote:
>
> Please cut unneded context - it makes it much easier to find the new
> text in your replies!
>
>> > +	if (ret)
>> > +		goto err_alloc;
>
>> err_alloc seems wrong.  The goto is taken when reading the revision
>> register fails, not on a failed allocation.
>
> His code is following the style of naming the exit points after what
> needs to be unwound rather than after the place jumped from which is
> common enough?
>
>> > +#define MC13892_PWGT1SPI	21
>> > +#define MC13892_PWGT2SPI	22
>> > +#define MC13892_VCOINCELL	23
>
>> I thought you wanted to put these somewhere below drivers/regulator/.
>
> Please.

If we move this header into drivers/regulator, how are we supposed to
declared regulators in the machine file ?
The regulator code does:
                priv->regulators[i] = regulator_register(
                                &mc13892_regulators[init_data->id].desc,
                                &pdev->dev, init_data->init_data, priv);

so, I'm declaring like this in the machine file:
static struct mc13xxx_regulator_init_data mx51_efikamx_regulators[] = {
        { .id = MC13892_SW1,            .init_data =  &sw1_init },
        { .id = MC13892_SW2,            .init_data =  &sw2_init },

I'm stupid enough to think that .id should match in the machine file and
in the regulator driver. Did I miss something ?

Arnaud



More information about the linux-arm-kernel mailing list