linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Daniel Hellstrom <daniel@gaisler.com>
Cc: linux-input@vger.kernel.org, software@gaisler.com
Subject: Re: [PATCH 1/1] input,serio: support for GRLIB APBPS2 PS/2 Keyboard/Mouse
Date: Thu, 21 Feb 2013 10:03:57 -0800	[thread overview]
Message-ID: <20130221180357.GA18737@core.coreip.homeip.net> (raw)
In-Reply-To: <5125EDB5.3070909@gaisler.com>

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

      reply	other threads:[~2013-02-21 18:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-20 14:41 [PATCH 1/1] input,serio: support for GRLIB APBPS2 PS/2 Keyboard/Mouse Daniel Hellstrom
2013-02-20 18:43 ` Dmitry Torokhov
2013-02-21  9:49   ` Daniel Hellstrom
2013-02-21 18:03     ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130221180357.GA18737@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=daniel@gaisler.com \
    --cc=linux-input@vger.kernel.org \
    --cc=software@gaisler.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).