public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Libo Chen <clbchenlibo.chen@huawei.com>
To: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: <wsa@the-dreams.de>, <uclinux-dist-devel@blackfin.uclinux.org>,
	<linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH 2/2] i2c: pxa: no need release_mem_region before request_mem_region successful
Date: Tue, 7 May 2013 13:55:16 +0800	[thread overview]
Message-ID: <51889744.1090109@huawei.com> (raw)
In-Reply-To: <51886E12.8070701@cn.fujitsu.com>

On 2013/5/7 10:59, Gu Zheng wrote:
> Hi libo,
> 
> On 05/06/2013 09:11 PM, Libo Chen wrote:
> 
>>
>> move release_mem_region above kfree(i2c) && below clk_put(i2c->clk)
>>
>> Signed-off-by: Libo Chen <libo.chen@huawei.com>
>> ---
>>  drivers/i2c/busses/i2c-pxa.c |    5 +++--
>>  1 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
>> index ea6d45d..3188cd0 100644
>> --- a/drivers/i2c/busses/i2c-pxa.c
>> +++ b/drivers/i2c/busses/i2c-pxa.c
>> @@ -1129,7 +1129,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
>>  	i2c->clk = clk_get(&dev->dev, NULL);
>>  	if (IS_ERR(i2c->clk)) {
>>  		ret = PTR_ERR(i2c->clk);
>> -		goto eclk;
>> +		goto emm;
> 
> The new tag 'emm' seems not suitable here, keep the original 'eclk' here, modify the upper 'eclk' tags instead:
> ...
> 	ret = i2c_pxa_probe_dt(dev, i2c, &i2c_type);
> 	if (ret > 0)
> 		ret = i2c_pxa_probe_pdata(dev, i2c, &i2c_type);
> 	if (ret < 0)
> -		goto eclk;
> +		goto etype;
> 
> 	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
> 	irq = platform_get_irq(dev, 0);
> 	if (res == NULL || irq < 0) {
> 		ret = -ENODEV;
> -		goto eclk;
> +		goto edev;


Thanks a lot.  Yes, it is . Original lable name seems not suitable.
but lable:edev is redundant, useless .

I concern this patch is usefull for your work? However I will change it later.

Thanks,
Libo


> 	}
> 
> 	if (!request_mem_region(res->start, resource_size(res), res->name)) {
> 		ret = -ENOMEM;
> -		goto eclk;
> +		goto emem;
> 	}
> ...
> 
>>  	}
>>
>>  	i2c->reg_base = ioremap(res->start, resource_size(res));
>> @@ -1206,10 +1206,11 @@ ereqirq:
>>  	iounmap(i2c->reg_base);
>>  eremap:
>>  	clk_put(i2c->clk);
>> +emm:
>> +	release_mem_region(res->start, resource_size(res));
>>  eclk:
>>  	kfree(i2c);
> 
>    eclk:
> 	release_mem_region(res->start, resource_size(res));
>    etype:
>    edev:
>    emem:
>   	kfree(i2c);
> 
>>  emalloc:
>> -	release_mem_region(res->start, resource_size(res));
>>  	return ret;
>>  }
>>
> 
> Thanks,
> Gu
> 
> 
> .
> 



      reply	other threads:[~2013-05-07  5:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06 13:11 [PATCH 2/2] i2c: pxa: no need release_mem_region before request_mem_region successful Libo Chen
2013-05-07  2:59 ` Gu Zheng
2013-05-07  5:55   ` Libo Chen [this message]

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=51889744.1090109@huawei.com \
    --to=clbchenlibo.chen@huawei.com \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=wsa@the-dreams.de \
    /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