|
@@ -329,13 +329,6 @@ static int armada_read_sensor(struct armada_thermal_priv *priv, int *temp)
|
|
u32 reg, div;
|
|
u32 reg, div;
|
|
s64 sample, b, m;
|
|
s64 sample, b, m;
|
|
|
|
|
|
- /* Valid check */
|
|
|
|
- if (priv->data->is_valid && !priv->data->is_valid(priv)) {
|
|
|
|
- dev_err(priv->dev,
|
|
|
|
- "Temperature sensor reading not valid\n");
|
|
|
|
- return -EIO;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
regmap_read(priv->syscon, priv->data->syscon_status_off, ®);
|
|
regmap_read(priv->syscon, priv->data->syscon_status_off, ®);
|
|
reg = (reg >> priv->data->temp_shift) & priv->data->temp_mask;
|
|
reg = (reg >> priv->data->temp_shift) & priv->data->temp_mask;
|
|
if (priv->data->signed_sample)
|
|
if (priv->data->signed_sample)
|
|
@@ -363,6 +356,13 @@ static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
|
|
struct armada_thermal_priv *priv = thermal->devdata;
|
|
struct armada_thermal_priv *priv = thermal->devdata;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ /* Valid check */
|
|
|
|
+ if (priv->data->is_valid && !priv->data->is_valid(priv)) {
|
|
|
|
+ dev_err(priv->dev,
|
|
|
|
+ "Temperature sensor reading not valid\n");
|
|
|
|
+ return -EIO;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* Do the actual reading */
|
|
/* Do the actual reading */
|
|
ret = armada_read_sensor(priv, temp);
|
|
ret = armada_read_sensor(priv, temp);
|
|
|
|
|