Re: [PATCH V3 3/3] mfd: palmas: Add support for optional wakeup

From: Thomas Gleixner
Date: Thu Nov 13 2014 - 05:03:26 EST


Tony,

On Thu, 6 Nov 2014, Tony Lindgren wrote:
>
> Any comments on the patch below? Let me know if you want to keep the
> devm stuff out of kernel/irq/manage.c.

Sorry, this slipped through the cracks.

> > +static int setup_wakeirq(struct device *dev, unsigned int wakeirq,
> > + unsigned long wakeflags, bool devm)
> > +{
> > + int ret;
> > +
> > + if (!(dev && wakeirq)) {
> > + pr_err("Missing device or wakeirq for %s irq %d\n",
> > + dev_name(dev), wakeirq);
> > + return -EINVAL;
> > + }
> > +
> > + if (!(wakeflags &
> > + (IRQF_TRIGGER_LOW | IRQF_TRIGGER_HIGH | IRQF_ONESHOT))) {
> > + pr_err("Invalid wakeirq for %s irq %d, must be level oneshot\n",
> > + dev_name(dev), wakeirq);

This looks odd.

Why do you want to enforce LEVEL and ONESHOT? I can see the point for
ONESHOT, but I'm wondering about the requirement for level.

Now if you really want to enforce level AND oneshot, your check is
wrong as it will not trigger on

wakeflags = IRQF_TRIGGER_LOW;
wakeflags = IRQF_TRIGGER_HIGH;
wakeflags = IRQF_ONESHOT;

Not what you really want, right?

> > +int request_wake_irq(struct device *dev, unsigned int wakeirq,
> > + unsigned long wakeflags)
> > +{
> > + return setup_wakeirq(dev, wakeirq, wakeflags, false);
> > +}
> > +EXPORT_SYMBOL(request_wake_irq);

_GPL please

> > +
> > +int devm_request_wake_irq(struct device *dev, unsigned int wakeirq,
> > + unsigned long wakeflags)
> > +{
> > + return setup_wakeirq(dev, wakeirq, wakeflags, false);

Shouldnt that have devm = true?

Thanks,

tglx
--
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/