aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/kirkwood_thermal.c
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2013-03-21 17:42:07 -0300
committerZhang Rui <rui.zhang@intel.com>2013-03-26 22:09:14 +0800
commit02519d3397b57bf723f6df69c92b0b66ecafb11a (patch)
tree2a3c05e2ce9fd1aba52325fa567edd0535b5540b /drivers/thermal/kirkwood_thermal.c
parentthermal: Fix compiler warning (diff)
downloadlinux-dev-02519d3397b57bf723f6df69c92b0b66ecafb11a.tar.xz
linux-dev-02519d3397b57bf723f6df69c92b0b66ecafb11a.zip
thermal: kirkwood: Fix valid check for thermal register
The correct value is obtain by first shifting the register by the offset, later applying the valid mask and finally invert the result. This check was lacking an extra parenthesis to be strictly correct. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/kirkwood_thermal.c')
-rw-r--r--drivers/thermal/kirkwood_thermal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
index e5500edb5285..d2e05eec722a 100644
--- a/drivers/thermal/kirkwood_thermal.c
+++ b/drivers/thermal/kirkwood_thermal.c
@@ -41,8 +41,8 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
reg = readl_relaxed(priv->sensor);
/* Valid check */
- if (!(reg >> KIRKWOOD_THERMAL_VALID_OFFSET) &
- KIRKWOOD_THERMAL_VALID_MASK) {
+ if (!((reg >> KIRKWOOD_THERMAL_VALID_OFFSET) &
+ KIRKWOOD_THERMAL_VALID_MASK)) {
dev_err(&thermal->device,
"Temperature sensor reading not valid\n");
return -EIO;