linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: sameo@linux.intel.com, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, spear-devel@list.st.com
Subject: Re: [PATCH V2 1/2] mfd: stmpe: Use devm_*() routines
Date: Thu, 22 Nov 2012 10:27:10 +0000	[thread overview]
Message-ID: <20121122102710.GD4328@gmail.com> (raw)
In-Reply-To: <f1d508c64a01dfd492a1ab1fda28af4b7647d8ab.1353560936.git.viresh.kumar@linaro.org>

On Thu, 22 Nov 2012, Viresh Kumar wrote:

> This patch frees stmpe driver from tension of freeing resources :)
> devm_* derivatives of multiple routines are used while allocating resources,
> which would be freed automatically by kernel.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> 
> V1->V2:
> ------
> - Rebased over latest for-next from Samuel
> - updated additional kzalloc with devm_kzalloc(), first one seen below.
> 
>  drivers/mfd/stmpe.c | 60 +++++++++++++++++++----------------------------------
>  1 file changed, 21 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> index ba157d4..c0df4b9 100644
> --- a/drivers/mfd/stmpe.c
> +++ b/drivers/mfd/stmpe.c
> @@ -1052,17 +1052,17 @@ int __devinit stmpe_probe(struct stmpe_client_info *ci, int partnum)
>  	int ret;
>  
>  	if (!pdata) {
> -		if (np) {
> -			pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
> -			if (!pdata)
> -				return -ENOMEM;
> -
> -			stmpe_of_probe(pdata, np);
> -		} else
> +		if (!np)

I'm assuming you've reversed the semantics here for >80 chars reasons?

I see no harm in it though.

Acked-by: Lee Jones <lee.jones@linaro.org>

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  parent reply	other threads:[~2012-11-22 19:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22  5:10 [PATCH V2 1/2] mfd: stmpe: Use devm_*() routines Viresh Kumar
2012-11-22  5:10 ` [PATCH V2 2/2] mfd: stmpe: Extend DT support in stmpe driver Viresh Kumar
2012-11-22 11:24   ` Lee Jones
2012-11-22 13:54     ` Viresh Kumar
2012-11-22 15:46       ` Lee Jones
2012-11-22 17:01         ` Viresh Kumar
2012-11-23  3:45           ` Shiraz Hashim
2012-11-23  9:33             ` Lee Jones
2012-11-23  9:23           ` Lee Jones
2012-11-22 18:31     ` Viresh Kumar
2012-11-23  9:39       ` Lee Jones
2012-11-23  4:29     ` Viresh Kumar
2012-11-23  9:36       ` Lee Jones
2012-11-23 12:39         ` Viresh Kumar
2012-11-23 15:43           ` Lee Jones
2012-11-23 15:45             ` Viresh Kumar
2012-11-22 10:27 ` Lee Jones [this message]
2012-11-22 10:30   ` [PATCH V2 1/2] mfd: stmpe: Use devm_*() routines Viresh Kumar
2012-11-22 17:10   ` Viresh Kumar
2012-11-23  9:40     ` Lee Jones
2012-11-23  9:42       ` Lee Jones
2012-11-23  9:44       ` Viresh Kumar
2012-11-23 11:03 ` Samuel Ortiz

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=20121122102710.GD4328@gmail.com \
    --to=lee.jones@linaro.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=spear-devel@list.st.com \
    --cc=viresh.kumar@linaro.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).