Skip to content

Commit

Permalink
thermal: armada: fix legacy validity test sense
Browse files Browse the repository at this point in the history
Commit 8c0e64a ("thermal: armada: get rid of the ->is_valid()
pointer") removed the unnecessary indirection through a function
pointer, but in doing so, also removed the negation operator too:

-       if (priv->data->is_valid && !priv->data->is_valid(priv)) {
+       if (armada_is_valid(priv)) {

which results in:

armada_thermal f06f808c.thermal: Temperature sensor reading not valid
armada_thermal f240007.thermal: Temperature sensor reading not valid
armada_thermal f4400078.thermal: Temperature sensor reading not valid

at boot, or whenever the "temp" sysfs file is read.  Replace the
negation operator.

Fixes: 8c0e64a ("thermal: armada: get rid of the ->is_valid() pointer")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
  • Loading branch information
Russell King authored and Eduardo Valentin committed Dec 5, 2018
1 parent 0072a0c commit 70bb27b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/thermal/armada_thermal.c
Expand Up @@ -357,7 +357,7 @@ static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
int ret; int ret;


/* Valid check */ /* Valid check */
if (armada_is_valid(priv)) { if (!armada_is_valid(priv)) {
dev_err(priv->dev, dev_err(priv->dev,
"Temperature sensor reading not valid\n"); "Temperature sensor reading not valid\n");
return -EIO; return -EIO;
Expand Down

0 comments on commit 70bb27b

Please sign in to comment.