Re: [PATCH 1/7] Input: pmic8xxx-pwrkey - Pass input devicedirectly to interrupt

From: Stephen Boyd
Date: Mon Dec 16 2013 - 14:59:16 EST


On 12/15, Dmitry Torokhov wrote:
> Hi Stephen,
>
> On Tue, Dec 10, 2013 at 03:43:10PM -0800, Stephen Boyd wrote:
> > Instead of passing the pointer to the container structure just
> > pass the input device here. This saves a dereference in the fast
> > path.
> >
> > Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>
> > ---
> > drivers/input/misc/pmic8xxx-pwrkey.c | 22 ++++++++--------------
> > 1 file changed, 8 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c
> > index ce3c426..233b216 100644
> > --- a/drivers/input/misc/pmic8xxx-pwrkey.c
> > +++ b/drivers/input/misc/pmic8xxx-pwrkey.c
> > @@ -32,26 +32,21 @@
> > * @key_press_irq: key press irq number
> > */
> > struct pmic8xxx_pwrkey {
> > - struct input_dev *pwr;
>
> This causes compile errors as you need pwrkey->pwr in remove() to
> unregister input device. I'll fix it up.
>

Ah sorry. I forgot to send the patch before this that converts it
to devm.

> > err = devm_request_irq(&pdev->dev, key_press_irq, pwrkey_press_irq,
> > - IRQF_TRIGGER_RISING, "pmic8xxx_pwrkey_press", pwrkey);
> > + IRQF_TRIGGER_RISING, "pmic8xxx_pwrkey_press", pwr);

As you can see here because this driver isn't currently using
devm_request_irq().

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
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/