From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Viresh Kumar <viresh.kumar@st.com>,
rajeev-dlh.kumar@st.com, devicetree-discuss@lists.ozlabs.org,
spear-devel@list.st.com, viresh.linux@gmail.com,
linux-input@vger.kernel.org
Subject: Re: [PATCH 1/2] input/of_keymap: Convert kzalloc to devm_kzalloc derivative
Date: Mon, 26 Mar 2012 08:55:02 -0700 [thread overview]
Message-ID: <20120326155502.GA25590@core.coreip.homeip.net> (raw)
In-Reply-To: <4F708A89.4090503@wwwdotorg.org>
On Mon, Mar 26, 2012 at 09:26:01AM -0600, Stephen Warren wrote:
> On 03/26/2012 03:45 AM, Viresh Kumar wrote:
> > matrix_keyboard_of_fill_keymap() routines allocates memory using kzalloc()
> > routine. It is freed on call to matrix_keyboard_of_free_keymap() routine.
> >
> > This patch converts these kzalloc() calls to devm_kzalloc() and thus we don't
> > require matrix_keyboard_of_free_keymap() anymore.
> >
> > Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
>
> The Tegra-related parts,
> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
>
> But that said, Dmitry specifically requested that the devm_* function
> not be used during initial review of this code; IIRC he preferred just
> doing the explicit frees. I can't find a link right now though.
Right, there is no need to haul allocated memory past the building of
the "real" keymap anyway.
Actually I want to change the interface so that we could do something
like:
if (pdata->keymap) {
matrix_keypad_build_keymap(...)
} else {
error = matrix_keypad_build_of_keymap();
if (error)
goto blah;
}
So that one could override OF data with plaform data if needed and no
freeing of intermediate platform-like keymap structure is requited.
Or maybe encapsulate OF parsing directly into matrix_keypad_build_keymap
if passed keymap data is NULL...
Thanks.
--
Dmitry
next prev parent reply other threads:[~2012-03-26 15:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-26 9:45 [PATCH 1/2] input/of_keymap: Convert kzalloc to devm_kzalloc derivative Viresh Kumar
2012-03-26 9:45 ` [PATCH 2/2] Input: spear-keyboard: add device tree bindings Viresh Kumar
2012-03-26 15:30 ` Stephen Warren
[not found] ` <4F708B8F.10602-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-03-26 15:35 ` viresh kumar
2012-03-26 15:26 ` [PATCH 1/2] input/of_keymap: Convert kzalloc to devm_kzalloc derivative Stephen Warren
2012-03-26 15:55 ` Dmitry Torokhov [this message]
2012-03-27 4:18 ` spear devel
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=20120326155502.GA25590@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-input@vger.kernel.org \
--cc=rajeev-dlh.kumar@st.com \
--cc=spear-devel@list.st.com \
--cc=swarren@wwwdotorg.org \
--cc=viresh.kumar@st.com \
--cc=viresh.linux@gmail.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).