projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
video: rockchip: iep: covert dsb() to dsb(sy)
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
hwmon
/
lm85.c
diff --git
a/drivers/hwmon/lm85.c
b/drivers/hwmon/lm85.c
index 3894c408fda3cedc1230742cc5c0a9a653227cd5..b9d6e7d0ba37c3207a0fe414c9199c93fb2f0111 100644
(file)
--- a/
drivers/hwmon/lm85.c
+++ b/
drivers/hwmon/lm85.c
@@
-158,7
+158,7
@@
static inline u16 FAN_TO_REG(unsigned long val)
/* Temperature is reported in .001 degC increments */
#define TEMP_TO_REG(val) \
/* Temperature is reported in .001 degC increments */
#define TEMP_TO_REG(val) \
-
clamp_val(SCALE(val, 1000, 1), -127, 127
)
+
DIV_ROUND_CLOSEST(clamp_val((val), -127000, 127000), 1000
)
#define TEMPEXT_FROM_REG(val, ext) \
SCALE(((val) << 4) + (ext), 16, 1000)
#define TEMP_FROM_REG(val) ((val) * 1000)
#define TEMPEXT_FROM_REG(val, ext) \
SCALE(((val) << 4) + (ext), 16, 1000)
#define TEMP_FROM_REG(val) ((val) * 1000)
@@
-192,7
+192,7
@@
static const int lm85_range_map[] = {
13300, 16000, 20000, 26600, 32000, 40000, 53300, 80000
};
13300, 16000, 20000, 26600, 32000, 40000, 53300, 80000
};
-static int RANGE_TO_REG(
int
range)
+static int RANGE_TO_REG(
long
range)
{
int i;
{
int i;
@@
-214,7
+214,7
@@
static const int adm1027_freq_map[8] = { /* 1 Hz */
11, 15, 22, 29, 35, 44, 59, 88
};
11, 15, 22, 29, 35, 44, 59, 88
};
-static int FREQ_TO_REG(const int *map,
int
freq)
+static int FREQ_TO_REG(const int *map,
unsigned long
freq)
{
int i;
{
int i;
@@
-463,6
+463,9
@@
static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr,
if (err)
return err;
if (err)
return err;
+ if (val > 255)
+ return -EINVAL;
+
data->vrm = val;
return count;
}
data->vrm = val;
return count;
}