mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
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>
This commit is contained in:
parent
f8b587055a
commit
02519d3397
1 changed files with 2 additions and 2 deletions
|
@ -41,8 +41,8 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
|
||||||
reg = readl_relaxed(priv->sensor);
|
reg = readl_relaxed(priv->sensor);
|
||||||
|
|
||||||
/* Valid check */
|
/* Valid check */
|
||||||
if (!(reg >> KIRKWOOD_THERMAL_VALID_OFFSET) &
|
if (!((reg >> KIRKWOOD_THERMAL_VALID_OFFSET) &
|
||||||
KIRKWOOD_THERMAL_VALID_MASK) {
|
KIRKWOOD_THERMAL_VALID_MASK)) {
|
||||||
dev_err(&thermal->device,
|
dev_err(&thermal->device,
|
||||||
"Temperature sensor reading not valid\n");
|
"Temperature sensor reading not valid\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue