public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Libo Chen <libo.chen@huawei.com>
Cc: guz.fnst@cn.fujitsu.com, sonic.zhang@analog.com,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	lizefan@huawei.com
Subject: Re: [PATCH RFC v3 2/3] i2c: pxa: convert to devm_* API
Date: Wed, 12 Jun 2013 12:02:33 +0200	[thread overview]
Message-ID: <20130612100232.GB3008@katana> (raw)
In-Reply-To: <1369310408-10348-1-git-send-email-libo.chen@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

On Thu, May 23, 2013 at 08:00:08PM +0800, Libo Chen wrote:
> when i2c malloc faild, we should not try to call release_mem_region.
> aovid this, convert them to devm_* API.
> 
> Signed-off-by: Libo Chen <libo.chen@huawei.com>

First, you did it right. This patch should not be combined with 1/3. It
is not a trivial cleanup, so I prefer to keep them seperated.

BTW did you test these patches on real hardware?

> @@ -1198,19 +1187,6 @@ static int i2c_pxa_probe(struct platform_device *dev)
>  #endif
>  	return 0;
>  
> -eadapt:
> -	if (!i2c->use_pio)
> -		free_irq(irq, i2c);
> -ereqirq:
> -	clk_disable(i2c->clk);
> -	iounmap(i2c->reg_base);
> -eremap:
> -	clk_put(i2c->clk);
> -eclk:
> -	kfree(i2c);
> -emalloc:
> -	release_mem_region(res->start, resource_size(res));
> -	return ret;
>  }
>  
>  static int i2c_pxa_remove(struct platform_device *dev)
> @@ -1218,15 +1194,6 @@ static int i2c_pxa_remove(struct platform_device *dev)
>  	struct pxa_i2c *i2c = platform_get_drvdata(dev);
>  
>  	i2c_del_adapter(&i2c->adap);
> -	if (!i2c->use_pio)
> -		free_irq(i2c->irq, i2c);
> -
> -	clk_disable(i2c->clk);
> -	clk_put(i2c->clk);
> -
> -	iounmap(i2c->reg_base);
> -	release_mem_region(i2c->iobase, i2c->iosize);
> -	kfree(i2c);

You remove too much. Who disables the clock now?


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      parent reply	other threads:[~2013-06-12 10:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 12:00 [PATCH RFC v3 2/3] i2c: pxa: convert to devm_* API Libo Chen
2013-05-24  3:35 ` Gu Zheng
2013-05-24  3:42   ` Li Zefan
2013-05-24  3:51   ` Libo Chen
2013-06-12 10:02 ` Wolfram Sang [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=20130612100232.GB3008@katana \
    --to=wsa@the-dreams.de \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=libo.chen@huawei.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=sonic.zhang@analog.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