Sensor selection when using multiple sensors already checks for the
sensor validity. Move it to the legacy ->get_temp() hook, where it is
still needed.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
u32 reg, div;
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, ®);
reg = (reg >> priv->data->temp_shift) & priv->data->temp_mask;
if (priv->data->signed_sample)
struct armada_thermal_priv *priv = thermal->devdata;
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 */
ret = armada_read_sensor(priv, temp);