projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a6c80b
)
ds1621: Fix negative temperature readings
author
Jeff Dischler
<jdischler@xes-inc.com>
Wed, 29 Sep 2010 18:46:19 +0000
(13:46 -0500)
committer
Wolfgang Denk
<wd@denx.de>
Wed, 6 Oct 2010 21:01:22 +0000
(23:01 +0200)
Fix bug where signed data was processed as unsigned. The bug previously
resulted in negative temperature readings wrapping around, eg -10 became
245.
Signed-off-by: Jeff Dischler <jdischler@xes-inc.com>
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
drivers/hwmon/ds1621.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/ds1621.c
b/drivers/hwmon/ds1621.c
index
60bf502
..
5a2ea62
100644
(file)
--- a/
drivers/hwmon/ds1621.c
+++ b/
drivers/hwmon/ds1621.c
@@
-80,7
+80,7
@@
int dtt_read(int sensor, int reg)
/* Handle 2 byte result */
if (dlen == 2)
- return (
(int)((short)data[1] + (((short)data[0]) << 8))
);
+ return (
short)((data[0] << 8) | data[1]
);
return (int)data[0];
}