mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: rcar_thermal: remove explicitly used devm_kfree/iounap()
Date: Wed, 07 Nov 2012 11:32:12 +0800	[thread overview]
Message-ID: <1352259132.2137.14.camel@rzhang1-mobl4> (raw)
In-Reply-To: <87ehlgrque.wl%kuninori.morimoto.gx@renesas.com>



On Tue, 2012-10-02 at 23:51 -0700, Kuninori Morimoto wrote:
> devm_kfree and devm_iounmap should not have to be explicitly used
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

applied to thermal-next.

thanks,
rui
> ---
> This patch is based on Devendra's
> [PATCH] thermal: solve compilation errors in rcar_thermal
> 
>  drivers/thermal/rcar_thermal.c |   18 ++----------------
>  1 file changed, 2 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 762f637..81dce23 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -185,7 +185,6 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  	struct thermal_zone_device *zone;
>  	struct rcar_thermal_priv *priv;
>  	struct resource *res;
> -	int ret;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {
> @@ -206,16 +205,14 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  					  res->start, resource_size(res));
>  	if (!priv->base) {
>  		dev_err(&pdev->dev, "Unable to ioremap thermal register\n");
> -		ret = -ENOMEM;
> -		goto error_free_priv;
> +		return -ENOMEM;
>  	}
>  
>  	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
>  				    &rcar_thermal_zone_ops, NULL, 0, 0);
>  	if (IS_ERR(zone)) {
>  		dev_err(&pdev->dev, "thermal zone device is NULL\n");
> -		ret = PTR_ERR(zone);
> -		goto error_iounmap;
> +		return PTR_ERR(zone);
>  	}
>  
>  	platform_set_drvdata(pdev, zone);
> @@ -223,26 +220,15 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  	dev_info(&pdev->dev, "proved\n");
>  
>  	return 0;
> -
> -error_iounmap:
> -	devm_iounmap(&pdev->dev, priv->base);
> -error_free_priv:
> -	devm_kfree(&pdev->dev, priv);
> -
> -	return ret;
>  }
>  
>  static int rcar_thermal_remove(struct platform_device *pdev)
>  {
>  	struct thermal_zone_device *zone = platform_get_drvdata(pdev);
> -	struct rcar_thermal_priv *priv = zone->devdata;
>  
>  	thermal_zone_device_unregister(zone);
>  	platform_set_drvdata(pdev, NULL);
>  
> -	devm_iounmap(&pdev->dev, priv->base);
> -	devm_kfree(&pdev->dev, priv);
> -
>  	return 0;
>  }
>  



  reply	other threads:[~2012-11-07  3:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21 16:31 [PATCH] thermal: solve compilation errors in rcar_thermal Devendra Naga
2012-08-28  1:05 ` Kuninori Morimoto
2012-10-03  6:51 ` [PATCH] thermal: rcar_thermal: remove explicitly used devm_kfree/iounap() Kuninori Morimoto
2012-11-07  3:32   ` Zhang Rui [this message]
2012-10-09  8:14 ` [PATCH] thermal: rcar: fixup compilation errors Kuninori Morimoto
2012-11-07  3:34   ` Zhang Rui
2012-10-31  3:21 ` [PATCH] thermal: solve compilation errors in rcar_thermal Kuninori Morimoto
2012-10-31  6:24   ` Zhang, Rui
2012-10-31  8:46     ` Kuninori Morimoto
2012-11-01  2:17       ` Zhang, Rui
2012-11-01  2:29   ` Fengguang Wu

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=1352259132.2137.14.camel@rzhang1-mobl4 \
    --to=rui.zhang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kuninori.morimoto.gx@gmail.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®