linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Zhang Rui <rui.zhang@intel.com>,
	Linux-SH <linux-sh@vger.kernel.org>,
	Linux-Kernel <linux-kernel@vger.kernel.org>,
	linux-pm@vger.kernel.org, cm-hiep@jinso.co.jp,
	nv-dung@jinso.co.jp
Subject: Re: [PATCH 1/2] thermal: rcar_thermal: remove redundant operation
Date: Mon, 16 Nov 2015 10:42:44 -0800	[thread overview]
Message-ID: <20151116184242.GA6349@localhost.localdomain> (raw)
In-Reply-To: <87egfylia4.wl%kuninori.morimoto.gx@renesas.com>

On Tue, Nov 10, 2015 at 02:12:06AM +0000, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> Probe error operation and remove operation are same.
> Let's use same function.

I am picking this one and sending for next rc cycle. The second  patch
is still under discussion and the issue may be solved differently,
so for now I wont get that. 

BR,

> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/thermal/rcar_thermal.c | 49 ++++++++++++++++++------------------------
>  1 file changed, 21 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 5d4ae7d..13d01ed 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -361,6 +361,24 @@ static irqreturn_t rcar_thermal_irq(int irq, void *data)
>  /*
>   *		platform functions
>   */
> +static int rcar_thermal_remove(struct platform_device *pdev)
> +{
> +	struct rcar_thermal_common *common = platform_get_drvdata(pdev);
> +	struct device *dev = &pdev->dev;
> +	struct rcar_thermal_priv *priv;
> +
> +	rcar_thermal_for_each_priv(priv, common) {
> +		if (rcar_has_irq_support(priv))
> +			rcar_thermal_irq_disable(priv);
> +		thermal_zone_device_unregister(priv->zone);
> +	}
> +
> +	pm_runtime_put(dev);
> +	pm_runtime_disable(dev);
> +
> +	return 0;
> +}
> +
>  static int rcar_thermal_probe(struct platform_device *pdev)
>  {
>  	struct rcar_thermal_common *common;
> @@ -377,6 +395,8 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  	if (!common)
>  		return -ENOMEM;
>  
> +	platform_set_drvdata(pdev, common);
> +
>  	INIT_LIST_HEAD(&common->head);
>  	spin_lock_init(&common->lock);
>  	common->dev = dev;
> @@ -454,43 +474,16 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  		rcar_thermal_common_write(common, ENR, enr_bits);
>  	}
>  
> -	platform_set_drvdata(pdev, common);
> -
>  	dev_info(dev, "%d sensor probed\n", i);
>  
>  	return 0;
>  
>  error_unregister:
> -	rcar_thermal_for_each_priv(priv, common) {
> -		if (rcar_has_irq_support(priv))
> -			rcar_thermal_irq_disable(priv);
> -		thermal_zone_device_unregister(priv->zone);
> -	}
> -
> -	pm_runtime_put(dev);
> -	pm_runtime_disable(dev);
> +	rcar_thermal_remove(pdev);
>  
>  	return ret;
>  }
>  
> -static int rcar_thermal_remove(struct platform_device *pdev)
> -{
> -	struct rcar_thermal_common *common = platform_get_drvdata(pdev);
> -	struct device *dev = &pdev->dev;
> -	struct rcar_thermal_priv *priv;
> -
> -	rcar_thermal_for_each_priv(priv, common) {
> -		if (rcar_has_irq_support(priv))
> -			rcar_thermal_irq_disable(priv);
> -		thermal_zone_device_unregister(priv->zone);
> -	}
> -
> -	pm_runtime_put(dev);
> -	pm_runtime_disable(dev);
> -
> -	return 0;
> -}
> -
>  static const struct of_device_id rcar_thermal_dt_ids[] = {
>  	{ .compatible = "renesas,rcar-thermal", },
>  	{},
> -- 
> 1.9.1
> 

  parent reply	other threads:[~2015-11-16 18:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87h9kulkfg.wl%kuninori.morimoto.gx@renesas.com>
2015-11-10  2:11 ` [PATCH 0/2] thermal: rcar_thermal: tidyup rebind issue Kuninori Morimoto
2015-11-10  2:12   ` [PATCH 1/2] thermal: rcar_thermal: remove redundant operation Kuninori Morimoto
2015-11-13 14:50     ` Ulf Hansson
2015-11-16 18:42     ` Eduardo Valentin [this message]
2015-11-10  2:12   ` [PATCH 2/2] thermal: rcar_thermal: use pm_runtime_put_sync() Kuninori Morimoto
2015-11-10  8:18     ` Geert Uytterhoeven
2015-11-10  9:57       ` Ulf Hansson
2015-11-10 10:10         ` Geert Uytterhoeven
2015-11-10 13:00           ` Ulf Hansson
2015-11-10 18:30             ` Eduardo Valentin
2015-11-11  0:11               ` Rafael J. Wysocki
2015-11-10 23:57             ` Rafael J. Wysocki
2015-11-11 11:03               ` Ulf Hansson
2015-11-12  1:06                 ` Rafael J. Wysocki
2015-11-12  8:04                   ` Ulf Hansson
2015-11-12 18:43                     ` Eduardo Valentin
2015-11-13 15:06                       ` Ulf Hansson
2015-11-11  2:41       ` Kuninori Morimoto
2015-11-10  2:18   ` [PATCH 0/2] thermal: rcar_thermal: tidyup rebind issue Kuninori Morimoto
2015-11-10  2:27     ` Nguyen Viet Dung
2015-11-10  5:15   ` Nguyen Viet Dung
     [not found]     ` <56499E53.2050905@jinso.co.jp>
2015-11-16 21:12       ` PM: after suspend/resume the system,can not suspends again Ulf Hansson
2015-11-17  1:35         ` Cao Minh Hiep

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=20151116184242.GA6349@localhost.localdomain \
    --to=edubezval@gmail.com \
    --cc=cm-hiep@jinso.co.jp \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=nv-dung@jinso.co.jp \
    --cc=rui.zhang@intel.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;
as well as URLs for NNTP newsgroup(s).