All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: linux-pm@vger.kernel.org,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-renesas-soc@vger.kernel.org,
	"Zhang Rui" <rui.zhang@intel.com>,
	"Eduardo Valentin" <edubezval@gmail.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH 3/7] thermal: rcar_gen3_thermal: remove unneeded mutex
Date: Mon,  6 Mar 2017 21:03:57 +0100	[thread overview]
Message-ID: <20170306200401.29923-4-niklas.soderlund+renesas@ragnatech.se> (raw)
In-Reply-To: <20170306200401.29923-1-niklas.soderlund+renesas@ragnatech.se>

There is no point in protecting a register read with a lock. This is
most likely a leftover from when the driver was reworked before submitted
for upstream.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/thermal/rcar_gen3_thermal.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
index 97958f91047b4c3a..5d4a5483eb13e796 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -20,7 +20,6 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/module.h>
-#include <linux/mutex.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
@@ -72,7 +71,6 @@ struct rcar_gen3_thermal_tsc {
 	void __iomem *base;
 	struct thermal_zone_device *zone;
 	struct equation_coefs coef;
-	struct mutex lock;
 };
 
 struct rcar_gen3_thermal_priv {
@@ -163,16 +161,12 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp)
 	u32 reg;
 
 	/* Read register and convert to mili Celsius */
-	mutex_lock(&tsc->lock);
-
 	reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK;
 
 	val1 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b1, tsc->coef.a1);
 	val2 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b2, tsc->coef.a2);
 	mcelsius = FIXPT_TO_MCELSIUS((val1 + val2) / 2);
 
-	mutex_unlock(&tsc->lock);
-
 	/* Make sure we are inside specifications */
 	if ((mcelsius < MCELSIUS(-40)) || (mcelsius > MCELSIUS(125)))
 		return -EIO;
@@ -301,7 +295,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
 		}
 
 		priv->tscs[i] = tsc;
-		mutex_init(&tsc->lock);
 
 		match_data->thermal_init(tsc);
 		rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]);
-- 
2.12.0

  parent reply	other threads:[~2017-03-06 20:16 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 20:03 [PATCH 0/7] thermal: rcar_gen3_thermal: add support for interrupt triggerd trip points Niklas Söderlund
2017-03-06 20:03 ` [PATCH 1/7] thermal: rcar_gen3_thermal: add delay in .thermal_init on r8a7796 Niklas Söderlund
2017-03-07  9:49   ` Sergei Shtylyov
2017-03-07 10:28     ` Niklas Söderlund
2017-03-07 10:28       ` Niklas Söderlund
2017-03-07 10:27   ` Niklas Söderlund
2017-03-07 10:27     ` Niklas Söderlund
2017-03-07 15:39   ` Geert Uytterhoeven
2017-03-07 19:51   ` Wolfram Sang
2017-03-06 20:03 ` [PATCH 2/7] thermal: rcar_gen3_thermal: fix probe error path Niklas Söderlund
2017-03-07 15:19   ` Geert Uytterhoeven
2017-03-07 19:52   ` Wolfram Sang
2017-03-17 10:12     ` Niklas Söderlund
2017-03-17 10:12       ` Niklas Söderlund
2017-03-06 20:03 ` Niklas Söderlund [this message]
2017-03-07 15:22   ` [PATCH 3/7] thermal: rcar_gen3_thermal: remove unneeded mutex Geert Uytterhoeven
2017-03-07 19:53   ` Wolfram Sang
2017-03-06 20:03 ` [PATCH 4/7] thermal: rcar_gen3_thermal: record more information about each TSC Niklas Söderlund
2017-03-07 15:31   ` Geert Uytterhoeven
2017-03-07 15:41   ` Geert Uytterhoeven
2017-03-07 19:55   ` Wolfram Sang
2017-03-06 20:03 ` [PATCH 5/7] thermal: rcar_gen3_thermal: enable hardware interrupts for trip points Niklas Söderlund
2017-03-07 15:36   ` Geert Uytterhoeven
2017-03-17 10:07     ` Niklas Söderlund
2017-03-17 10:07       ` Niklas Söderlund
2017-03-07 19:55   ` Wolfram Sang
2017-03-17 10:06     ` Niklas Söderlund
2017-03-17 10:06       ` Niklas Söderlund
2017-03-21 13:50       ` Geert Uytterhoeven
2017-03-06 20:04 ` [PATCH 6/7] thermal: rcar_gen3_thermal: store device match data in private structure Niklas Söderlund
2017-03-07 15:37   ` Geert Uytterhoeven
2017-03-07 19:55   ` Wolfram Sang
2017-03-06 20:04 ` [PATCH 7/7] thermal: rcar_gen3_thermal: add suspend and resume support Niklas Söderlund
2017-03-07 15:38   ` Geert Uytterhoeven
2017-03-07 19:55   ` 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=20170306200401.29923-4-niklas.soderlund+renesas@ragnatech.se \
    --to=niklas.soderlund+renesas@ragnatech.se \
    --cc=edubezval@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=wsa+renesas@sang-engineering.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.