All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Libo Chen <libo.chen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: guz.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org,
	sonic.zhang-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org
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-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1356 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-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

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 --]

WARNING: multiple messages have this Message-ID (diff)
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:02 UTC|newest]

Thread overview: 10+ 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-23 12:00 ` Libo Chen
     [not found] ` <1369310408-10348-1-git-send-email-libo.chen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-05-24  3:35   ` Gu Zheng
2013-05-24  3:35     ` Gu Zheng
     [not found]     ` <519EDFFC.5020308-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-05-24  3:42       ` Li Zefan
2013-05-24  3:42         ` Li Zefan
2013-05-24  3:51       ` Libo Chen
2013-05-24  3:51         ` Libo Chen
2013-06-12 10:02   ` Wolfram Sang [this message]
2013-06-12 10:02     ` Wolfram Sang

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-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
    --cc=guz.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org \
    --cc=libo.chen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=sonic.zhang-OyLXuOCK7orQT0dZR+AlfA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.