From: Simon Glass <sjg@chromium.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Samuel Ortiz <sameo@linux.intel.com>,
Luigi Semenzato <semenzato@chromium.org>,
Vincent Palatin <vpalatin@chromium.org>,
Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
Rob Landley <rob@landley.net>, Felipe Balbi <balbi@ti.com>,
Sourav Poddar <sourav.poddar@ti.com>,
Tony Lindgren <tony@atomide.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Mike A. Chan" <mikechan@google.com>,
Jun Nakajima <jun.nakajima@intel.com>,
Tom Keel <thomas.keel@intel.com>,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
linux-input@vger.kernel.org
Subject: Re: [PATCH v4 6/6] Input: Add ChromeOS EC keyboard driver
Date: Mon, 18 Feb 2013 20:13:42 -0800 [thread overview]
Message-ID: <CAPnjgZ3Y88uwrwF7M7-EijA3N8y_jgbcOBeSNtM6T6iG8hW0RQ@mail.gmail.com> (raw)
In-Reply-To: <20130216204954.GA22044@core.coreip.homeip.net>
Hi Dmitry,
On Sat, Feb 16, 2013 at 12:49 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Hi Simon,
>
> On Fri, Feb 15, 2013 at 08:16:12PM -0800, Simon Glass wrote:
>> + for (row = 0; row < ckdev->rows; row++) {
>> + if (cros_ec_keyb_row_has_ghosting(ckdev, buf, row))
>> + return true;
>> + }
>
> No need for curly braces here. I would not care if not for below.
OK I dont't think I even knew about that rule. Actually, what is that rule?
>
>> +
>> + return 0;
>> +
>> +fail_register:
>> + kfree(idev->keycode);
>
> Sorry I did not notice this before, but idev->keycode is devm-managed,
> so you either need to use devm_kfree() or just remove call to kfree()
> and let it clean up automatically (which will happen if binding fails or
> upon removal).
>
> BTW, maybe you should move the whole driver to devm_*? We have
> devm_kzalloc() for ckdev and you can use devm_input_allocate_device().
> Then you can get rid of entire erro handling path and completely remove
> the remove() method as well.
Yes I was thinking about that - might as well do it now.
>
>> +fail_matrix:
>> + input_free_device(idev);
>> +fail_alloc_dev:
>> + kfree(ckdev);
>> + return err;
>> +}
>> +
>
> Thanks.
>
> --
> Dmitry
Regards,
Simon
next prev parent reply other threads:[~2013-02-19 4:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-16 4:16 [PATCH v4 0/6] Add ChromeOS Embedded Controller support Simon Glass
2013-02-16 4:16 ` [PATCH v4 1/6] mfd: Add ChromeOS EC messages header Simon Glass
2013-02-16 4:16 ` [PATCH v4 2/6] mfd: Add ChromeOS EC implementation Simon Glass
2013-02-16 4:16 ` [PATCH v4 3/6] mfd: Add ChromeOS EC I2C driver Simon Glass
2013-02-16 9:06 ` Felipe Balbi
2013-02-16 14:46 ` Simon Glass
2013-02-18 7:40 ` Felipe Balbi
2013-02-16 4:16 ` [PATCH v4 4/6] mfd: Add ChromeOS EC SPI driver Simon Glass
2013-02-16 4:16 ` [PATCH v4 5/6] Input: matrix-keymap: Add function to read the new DT binding Simon Glass
2013-02-16 4:16 ` [PATCH v4 6/6] Input: Add ChromeOS EC keyboard driver Simon Glass
2013-02-16 20:49 ` Dmitry Torokhov
2013-02-19 4:13 ` Simon Glass [this message]
2013-02-19 7:20 ` Joe Perches
2013-02-19 8:18 ` Dmitry Torokhov
2013-02-19 8:36 ` li guang
2013-02-19 16:58 ` Simon Glass
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=CAPnjgZ3Y88uwrwF7M7-EijA3N8y_jgbcOBeSNtM6T6iG8hW0RQ@mail.gmail.com \
--to=sjg@chromium.org \
--cc=balbi@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dmitry.torokhov@gmail.com \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@linuxfoundation.org \
--cc=jun.nakajima@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikechan@google.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=sameo@linux.intel.com \
--cc=semenzato@chromium.org \
--cc=sourav.poddar@ti.com \
--cc=thomas.keel@intel.com \
--cc=tony@atomide.com \
--cc=vpalatin@chromium.org \
/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).