linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Miguel Aguilar <miguel.aguilar@ridgerun.com>
Cc: nsnehaprabha@ti.com,
	davinci-linux-open-source@linux.davincidsp.com,
	linux-input@vger.kernel.org, todd.fischer@ridgerun.com,
	diego.dompe@ridgerun.com, clark.becker@ridgerun.com,
	santiago.nunez@ridgerun.com
Subject: Re: [PATCH 1/3] Input: DaVinci Key Scan Driver
Date: Mon, 28 Sep 2009 10:02:22 -0700	[thread overview]
Message-ID: <20090928170222.GC21455@core.coreip.homeip.net> (raw)
In-Reply-To: <4ABCD179.9010007@ridgerun.com>

On Fri, Sep 25, 2009 at 08:19:37AM -0600, Miguel Aguilar wrote:
> Dmitry Torokhov wrote:
>>
>>> +
>>> +	davinci_ks = kzalloc(sizeof(struct davinci_ks) +
>>> +		sizeof(unsigned short) * pdata->keymapsize, GFP_KERNEL);
>>> +	if(!davinci_ks) {
>>> +		dev_dbg(dev, "could not allocate memory for private data\n");
>>> +		return -ENOMEM;
>>> +	}
>>> +
>>> +	if (!pdata->keymap) {
>>> +		dev_dbg(dev, "no keymap from pdata\n");
>>
>> You are leaking davinci_ks here. Maybe you should check pdata->keymap
>> first.
> [MA] Do you mean check pdata->keymap before davinci_ks allocation?

Yes.

>>> +
>>> +	ret = input_register_device(davinci_ks->input);
>>> +	if (ret < 0) {
>>> +		dev_err(dev, "unable to register DaVinci keyscan device\n");
>>> +		goto fail4;
>>> +	}
>>> +
>>> +	ret = request_irq(davinci_ks->irq, davinci_ks_interrupt, IRQF_DISABLED,
>>> +                         "davinci_keyscan", davinci_ks);
>>> +	if (ret < 0) {
>>> +		dev_err(dev, "unable to register DaVinci keyscan Interrupt\n");
>>> +		goto fail5;
>>> +	}
>>
>> FWIW you may request IRQ before registering the device - as soon as it
>> is alloctaed it can survive events going through it.
> [MA] Ok. request_irq before input_register_device.
>>

You don't have to change it, it was more of FYI item because sometimes
registering IRQ first simplifies error unwinding.

-- 
Dmitry

  reply	other threads:[~2009-09-28 17:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24 16:53 [PATCH 1/3] Input: DaVinci Key Scan Driver miguel.aguilar
2009-09-24 17:13 ` Miguel Aguilar
2009-09-25  4:01 ` Dmitry Torokhov
2009-09-25 14:19   ` Miguel Aguilar
2009-09-28 17:02     ` Dmitry Torokhov [this message]
2009-09-25  6:13 ` Nori, Sekhar
2009-09-25 14:21   ` Miguel Aguilar
2009-09-25 14:31     ` Nori, Sekhar
     [not found]       ` <B85A65D85D7EB246BE421B3FB0FBB59301DDAB36C3-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-09-25 14:39         ` Paulraj, Sandeep
     [not found]           ` <0554BEF07D437848AF01B9C9B5F0BC5D92C8EBC0-bGftbgMkZa+IQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-09-25 14:45             ` Miguel Aguilar
2009-09-28 17:02               ` Dmitry Torokhov
2009-09-28 17:06                 ` Paulraj, Sandeep
2009-09-29 21:24                   ` Kevin Hilman
2009-09-30 13:40                     ` Miguel Aguilar
2009-10-05 17:54                       ` Dmitry Torokhov
     [not found]                         ` <20091005175428.GB18588-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2009-10-05 19:29                           ` Miguel Aguilar
2009-09-28 17:14               ` Paulraj, Sandeep

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=20090928170222.GC21455@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=clark.becker@ridgerun.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=diego.dompe@ridgerun.com \
    --cc=linux-input@vger.kernel.org \
    --cc=miguel.aguilar@ridgerun.com \
    --cc=nsnehaprabha@ti.com \
    --cc=santiago.nunez@ridgerun.com \
    --cc=todd.fischer@ridgerun.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).