[linux-sunxi] Re: [PATCH 1/3] mfd: axp20x: Add mfd driver for axp20x PMIC

Carlo Caione
2014-02-11T06:58:01Z

On Mon, Feb 10, 2014 at 11:34 PM, Carlo Caione <carlo@caione.org> wrote:

>>> +static struct axp20x_dev *axp20x_pm_power_off;
>>
>> This looks pretty unconventional. What's the point of it?
>
> On a single board we can have multiple AXPs so I track which one is in
> charge of powering off the board (and to get the correct device in the
> axp20x_power_off())

<snip>

>>> +
>>> + if (!pm_power_off) {
>>> + axp20x_pm_power_off = axp20x;
>>> + pm_power_off = axp20x_power_off;
>>> + }
>>
>> Can you describe to me what you're using the pm_power_off call-back
>> for please?
>
> It's meant to poweroff the board

Actually what is missing here is also a way to determine which device
is in charge of powering off when multiple AXPs are registered.
I'll fix it in v2.

Thanks,

--
Carlo Caione