Skip to content

Commit 100cfbc

Browse files
Niklas SöderlundEduardo Valentin
authored andcommitted
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: Niklas Söderlund <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
1 parent 78aefd2 commit 100cfbc

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

drivers/thermal/rcar_gen3_thermal.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <linux/interrupt.h>
2121
#include <linux/io.h>
2222
#include <linux/module.h>
23-
#include <linux/mutex.h>
2423
#include <linux/of_device.h>
2524
#include <linux/platform_device.h>
2625
#include <linux/pm_runtime.h>
@@ -72,7 +71,6 @@ struct rcar_gen3_thermal_tsc {
7271
void __iomem *base;
7372
struct thermal_zone_device *zone;
7473
struct equation_coefs coef;
75-
struct mutex lock;
7674
};
7775

7876
struct rcar_gen3_thermal_priv {
@@ -163,16 +161,12 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp)
163161
u32 reg;
164162

165163
/* Read register and convert to mili Celsius */
166-
mutex_lock(&tsc->lock);
167-
168164
reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK;
169165

170166
val1 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b1, tsc->coef.a1);
171167
val2 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b2, tsc->coef.a2);
172168
mcelsius = FIXPT_TO_MCELSIUS((val1 + val2) / 2);
173169

174-
mutex_unlock(&tsc->lock);
175-
176170
/* Make sure we are inside specifications */
177171
if ((mcelsius < MCELSIUS(-40)) || (mcelsius > MCELSIUS(125)))
178172
return -EIO;
@@ -299,7 +293,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
299293
}
300294

301295
priv->tscs[i] = tsc;
302-
mutex_init(&tsc->lock);
303296

304297
match_data->thermal_init(tsc);
305298
rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]);

0 commit comments

Comments
 (0)