2015-06-02 13:45:19

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v2 4/6] gpio: brcmstb: Allow GPIOs to be wakeup sources

On Fri, May 29, 2015 at 4:14 AM, Gregory Fong <[email protected]> wrote:

> Several drivers (e.g. gpio-keys) allow for GPIOs to be configured as
> wakeup sources, and this GPIO controller supports that through a
> separate interrupt path.
>
> The de-facto standard DT property "wakeup-source" is checked, since
> that indicates whether the GPIO controller hardware can wake. Uses
> the IRQCHIP_MASK_ON_SUSPEND irq_chip flag because UPG GIO doesn't have
> any of its own wakeup source configuration.
>
> Signed-off-by: Gregory Fong <[email protected]>

(...)
> + if (enable)
> + enable_irq_wake(priv->parent_wake_irq);
> + else
> + disable_irq_wake(priv->parent_wake_irq);
> + return 0;

No error handling? If the code assumes these calls will
always succeed, atleast write that in a comment.

Yours,
Linus Walleij


2015-06-02 17:28:26

by Gregory Fong

[permalink] [raw]
Subject: Re: [PATCH v2 4/6] gpio: brcmstb: Allow GPIOs to be wakeup sources

On Tue, Jun 2, 2015 at 6:45 AM, Linus Walleij <[email protected]> wrote:
> On Fri, May 29, 2015 at 4:14 AM, Gregory Fong <[email protected]> wrote:
>
>> Several drivers (e.g. gpio-keys) allow for GPIOs to be configured as
>> wakeup sources, and this GPIO controller supports that through a
>> separate interrupt path.
>>
>> The de-facto standard DT property "wakeup-source" is checked, since
>> that indicates whether the GPIO controller hardware can wake. Uses
>> the IRQCHIP_MASK_ON_SUSPEND irq_chip flag because UPG GIO doesn't have
>> any of its own wakeup source configuration.
>>
>> Signed-off-by: Gregory Fong <[email protected]>
>
> (...)
>> + if (enable)
>> + enable_irq_wake(priv->parent_wake_irq);
>> + else
>> + disable_irq_wake(priv->parent_wake_irq);
>> + return 0;
>
> No error handling? If the code assumes these calls will
> always succeed, atleast write that in a comment.

Will add error handling.

Thanks,
Gregory