devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Simon Glass <sjg@chromium.org>
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: Sat, 16 Feb 2013 12:49:54 -0800	[thread overview]
Message-ID: <20130216204954.GA22044@core.coreip.homeip.net> (raw)
In-Reply-To: <1360988172-15380-7-git-send-email-sjg@chromium.org>

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.

> +
> +	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.
 
> +fail_matrix:
> +	input_free_device(idev);
> +fail_alloc_dev:
> +	kfree(ckdev);
> +	return err;
> +}
> +

Thanks.

-- 
Dmitry

  reply	other threads:[~2013-02-16 20:49 UTC|newest]

Thread overview: 9+ 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
     [not found] ` <1360988172-15380-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-02-16  4:16   ` [PATCH v4 2/6] mfd: Add ChromeOS EC implementation 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 [this message]
2013-02-19  4:13     ` Simon Glass
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=20130216204954.GA22044@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=balbi@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --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=sjg@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).