Commit 100cfbcf authored by Niklas Söderlund's avatar Niklas Söderlund Committed by Eduardo Valentin

thermal: rcar_gen3_thermal: remove unneeded mutex

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 being
submitted for upstream.
Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent 78aefd2d
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
...@@ -72,7 +71,6 @@ struct rcar_gen3_thermal_tsc { ...@@ -72,7 +71,6 @@ struct rcar_gen3_thermal_tsc {
void __iomem *base; void __iomem *base;
struct thermal_zone_device *zone; struct thermal_zone_device *zone;
struct equation_coefs coef; struct equation_coefs coef;
struct mutex lock;
}; };
struct rcar_gen3_thermal_priv { struct rcar_gen3_thermal_priv {
...@@ -163,16 +161,12 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp) ...@@ -163,16 +161,12 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp)
u32 reg; u32 reg;
/* Read register and convert to mili Celsius */ /* Read register and convert to mili Celsius */
mutex_lock(&tsc->lock);
reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK; reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK;
val1 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b1, tsc->coef.a1); val1 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b1, tsc->coef.a1);
val2 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b2, tsc->coef.a2); val2 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b2, tsc->coef.a2);
mcelsius = FIXPT_TO_MCELSIUS((val1 + val2) / 2); mcelsius = FIXPT_TO_MCELSIUS((val1 + val2) / 2);
mutex_unlock(&tsc->lock);
/* Make sure we are inside specifications */ /* Make sure we are inside specifications */
if ((mcelsius < MCELSIUS(-40)) || (mcelsius > MCELSIUS(125))) if ((mcelsius < MCELSIUS(-40)) || (mcelsius > MCELSIUS(125)))
return -EIO; return -EIO;
...@@ -299,7 +293,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) ...@@ -299,7 +293,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
} }
priv->tscs[i] = tsc; priv->tscs[i] = tsc;
mutex_init(&tsc->lock);
match_data->thermal_init(tsc); match_data->thermal_init(tsc);
rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]); rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment