From: Ezequiel Garcia Date: Thu, 21 Mar 2013 20:42:07 +0000 (-0300) Subject: thermal: kirkwood: Fix valid check for thermal register X-Git-Tag: upstream/snapshot3+hdmi~5140^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02519d3397b57bf723f6df69c92b0b66ecafb11a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c index e5500ed..d2e05ee 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;