You need to sign in or sign up before continuing.
提交 02519d33 编写于 作者: E Ezequiel Garcia 提交者: Zhang Rui

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: NEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: NZhang Rui <rui.zhang@intel.com>
上级 f8b58705
...@@ -41,8 +41,8 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal, ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册