On Thu, Feb 21, 2013 at 10:49:41AM +0100, Daniel Hellstrom wrote:
> On 02/20/2013 07:43 PM, Dmitry Torokhov wrote:
> >Hi Daniel,
> >
> >On Wed, Feb 20, 2013 at 03:41:33PM +0100, Daniel Hellstrom wrote:
> >>+static void apbps2_close(struct serio *io)
> >>+{
> >>+ struct apbps2_priv *priv = io->port_data;
> >>+
> >>+ /* stop interrupts at PS/2 HW level */
> >>+ APBPS2_WRITE(&priv->regs->ctrl, 0);
> >>+
> >>+ /* unregister PS/2 interrupt handler */
> >>+ devm_free_irq(&io->dev, priv->irq, priv);
> >What is the benefit (except for wasting memory) of using
> >devm_request_irq()/devm_free_irq() in this fashion?
> None.
>
> >
> >By the way, I would prefer if request IRQ was done in probe and freeing
> >in remove. I know that many existing serio drivers do it in open/close,
> >but this is not correct. We shoudl make sure all resources are available
> >beforehand.
> This has been done to avoid spending time in the APBPS2 ISR when the
> PS/2 interface is not used, and the interrupt is shared with another
> hardware.
Thankfully your device seems to be able shut off interrupts at the
controller level, so this should not be an issue.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html