Skip to content
Permalink
Browse files

thermal: armada: fix legacy validity test sense

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 f2400078.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 Eduardo Valentin
Russell King authored and Eduardo Valentin committed Nov 9, 2018
1 parent 0072a0c commit 70bb27b79adf63ea39e37371d09c823c7a8f93ce
Showing with 1 addition and 1 deletion.
  1. +1 −1 drivers/thermal/armada_thermal.c
@@ -357,7 +357,7 @@ static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
int ret;

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

0 comments on commit 70bb27b

Please sign in to comment.
You can’t perform that action at this time.