[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPnjgZ3Y88uwrwF7M7-EijA3N8y_jgbcOBeSNtM6T6iG8hW0RQ@mail.gmail.com>
Date: Mon, 18 Feb 2013 20:13:42 -0800
From: Simon Glass <sjg@...omium.org>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Samuel Ortiz <sameo@...ux.intel.com>,
Luigi Semenzato <semenzato@...omium.org>,
Vincent Palatin <vpalatin@...omium.org>,
Grant Likely <grant.likely@...retlab.ca>,
Rob Herring <rob.herring@...xeda.com>,
Rob Landley <rob@...dley.net>, Felipe Balbi <balbi@...com>,
Sourav Poddar <sourav.poddar@...com>,
Tony Lindgren <tony@...mide.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Mike A. Chan" <mikechan@...gle.com>,
Jun Nakajima <jun.nakajima@...el.com>,
Tom Keel <thomas.keel@...el.com>,
devicetree-discuss@...ts.ozlabs.org, linux-doc@...r.kernel.org,
linux-input@...r.kernel.org
Subject: Re: [PATCH v4 6/6] Input: Add ChromeOS EC keyboard driver
Hi Dmitry,
On Sat, Feb 16, 2013 at 12:49 PM, Dmitry Torokhov
<dmitry.torokhov@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists