All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Simon <horms@verge.net.au>, Zhang Rui <rui.zhang@intel.com>,
	Eduardo Valentin <edubezval@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Magnus <magnus.damm@gmail.com>,
	linux-sh@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: [PATCH 3/8 v5] thermal: rcar: check irq possibility in rcar_thermal_irq_xxx()
Date: Tue, 15 Dec 2015 01:17:56 +0000	[thread overview]
Message-ID: <878u4wqzq9.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87d1u8qzsy.wl%kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Current rcar thermal driver sometimes checks irq possibility when it
calls rcar_thermal_irq_enable/disable(), but sometimes not.
This patch checks it inside rcar_thermal_irq_enable/disable().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v4 -> v5

 - no change

 drivers/thermal/rcar_thermal.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 0b19743..e9e4e39 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -290,6 +290,9 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable)
 	unsigned long flags;
 	u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */
 
+	if (!rcar_has_irq_support(priv))
+		return;
+
 	spin_lock_irqsave(&common->lock, flags);
 
 	rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask);
@@ -441,8 +444,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 			goto error_unregister;
 		}
 
-		if (rcar_has_irq_support(priv))
-			rcar_thermal_irq_enable(priv);
+		rcar_thermal_irq_enable(priv);
 
 		list_move_tail(&priv->list, &common->head);
 
@@ -488,8 +490,7 @@ static int rcar_thermal_remove(struct platform_device *pdev)
 	struct rcar_thermal_priv *priv;
 
 	rcar_thermal_for_each_priv(priv, common) {
-		if (rcar_has_irq_support(priv))
-			rcar_thermal_irq_disable(priv);
+		rcar_thermal_irq_disable(priv);
 		thermal_zone_device_unregister(priv->zone);
 	}
 
-- 
1.9.1


WARNING: multiple messages have this Message-ID (diff)
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Simon <horms@verge.net.au>, Zhang Rui <rui.zhang@intel.com>,
	Eduardo Valentin <edubezval@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Magnus <magnus.damm@gmail.com>, <linux-sh@vger.kernel.org>,
	<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: [PATCH 3/8 v5] thermal: rcar: check irq possibility in rcar_thermal_irq_xxx()
Date: Tue, 15 Dec 2015 01:17:56 +0000	[thread overview]
Message-ID: <878u4wqzq9.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87d1u8qzsy.wl%kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Current rcar thermal driver sometimes checks irq possibility when it
calls rcar_thermal_irq_enable/disable(), but sometimes not.
This patch checks it inside rcar_thermal_irq_enable/disable().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v4 -> v5

 - no change

 drivers/thermal/rcar_thermal.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 0b19743..e9e4e39 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -290,6 +290,9 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable)
 	unsigned long flags;
 	u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */
 
+	if (!rcar_has_irq_support(priv))
+		return;
+
 	spin_lock_irqsave(&common->lock, flags);
 
 	rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask);
@@ -441,8 +444,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 			goto error_unregister;
 		}
 
-		if (rcar_has_irq_support(priv))
-			rcar_thermal_irq_enable(priv);
+		rcar_thermal_irq_enable(priv);
 
 		list_move_tail(&priv->list, &common->head);
 
@@ -488,8 +490,7 @@ static int rcar_thermal_remove(struct platform_device *pdev)
 	struct rcar_thermal_priv *priv;
 
 	rcar_thermal_for_each_priv(priv, common) {
-		if (rcar_has_irq_support(priv))
-			rcar_thermal_irq_disable(priv);
+		rcar_thermal_irq_disable(priv);
 		thermal_zone_device_unregister(priv->zone);
 	}
 
-- 
1.9.1


  parent reply	other threads:[~2015-12-15  1:17 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15  1:16 [PATCH 0/8 v5] enable to use thermal-zone on r8a7790/1 Kuninori Morimoto
2015-12-15  1:16 ` Kuninori Morimoto
2015-12-15  1:17 ` [PATCH 1/8 v5] thermal: rcar: move rcar_thermal_dt_ids to upside Kuninori Morimoto
2015-12-15  1:17   ` Kuninori Morimoto
2015-12-15  1:17 ` [PATCH 2/8 v5] thermal: rcar: check every rcar_thermal_update_temp() return value Kuninori Morimoto
2015-12-15  1:17   ` Kuninori Morimoto
2015-12-15  1:17 ` Kuninori Morimoto [this message]
2015-12-15  1:17   ` [PATCH 3/8 v5] thermal: rcar: check irq possibility in rcar_thermal_irq_xxx() Kuninori Morimoto
2015-12-15  1:18 ` [PATCH 4/8 v5] thermal: rcar: rcar_thermal_get_temp() return error if strange temp Kuninori Morimoto
2015-12-15  1:18   ` Kuninori Morimoto
2015-12-15  1:18 ` [PATCH 5/8 v5] thermal: rcar: enable to use thermal-zone on DT Kuninori Morimoto
2015-12-15  1:18   ` Kuninori Morimoto
2015-12-15  1:18   ` Kuninori Morimoto
2015-12-17 20:37   ` Eduardo Valentin
2015-12-17 20:37     ` Eduardo Valentin
2015-12-18  0:25     ` [PATCH 5/8 v6] " Kuninori Morimoto
2015-12-18  0:25       ` Kuninori Morimoto
2015-12-18  0:25       ` Kuninori Morimoto
     [not found]       ` <87wpsctxjv.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2015-12-19  4:17         ` Rob Herring
2015-12-19  4:17           ` Rob Herring
2015-12-19  4:17           ` Rob Herring
2015-12-21  0:56           ` Kuninori Morimoto
2015-12-21  0:56             ` Kuninori Morimoto
2016-01-05  8:08       ` Kuninori Morimoto
2016-01-05  8:08         ` Kuninori Morimoto
2016-01-05  8:08         ` Kuninori Morimoto
2015-12-15  1:18 ` [PATCH 6/8 v5] ARM: shmobile: r8a7790: enable to use thermal-zone Kuninori Morimoto
2015-12-15  1:18   ` Kuninori Morimoto
2015-12-15  1:19 ` [PATCH 7/8 v5] ARM: shmobile: r8a7791: " Kuninori Morimoto
2015-12-15  1:19   ` Kuninori Morimoto
2015-12-15  1:19 ` [PATCH 8/8 v5] thermal: trip_point_temp_store() calls thermal_zone_device_update() Kuninori Morimoto
2015-12-15  1:19   ` Kuninori Morimoto
2015-12-15  4:49 ` [PATCH 0/8 v5] enable to use thermal-zone on r8a7790/1 Simon Horman
2015-12-15  4:49   ` Simon Horman
     [not found] ` <87d1u8qzsy.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2015-12-17 21:08   ` Eduardo Valentin
2015-12-17 21:08     ` Eduardo Valentin
2015-12-17 21:08     ` Eduardo Valentin

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=878u4wqzq9.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=horms@verge.net.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --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 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.