Skip to content

Commit

Permalink
thermal: kirkwood: Fix valid check for thermal register
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ezequiel Garcia authored and Zhang Rui committed Mar 26, 2013
1 parent f8b5870 commit 02519d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/thermal/kirkwood_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 02519d3

Please sign in to comment.