summaryrefslogtreecommitdiff
path: root/drivers/thermal/armada_thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/armada_thermal.c')
-rw-r--r--drivers/thermal/armada_thermal.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index 2efc222a379b..0e8dfa6a7757 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -360,11 +360,8 @@ static int armada_select_channel(struct armada_thermal_priv *priv, int channel)
* we must absolutely wait for the sensor validity bit to ensure we read
* actual data.
*/
- if (armada_wait_sensor_validity(priv)) {
- dev_err(priv->dev,
- "Temperature sensor reading not valid\n");
+ if (armada_wait_sensor_validity(priv))
return -EIO;
- }
return 0;
}
@@ -398,15 +395,12 @@ static int armada_read_sensor(struct armada_thermal_priv *priv, int *temp)
static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
int *temp)
{
- struct armada_thermal_priv *priv = thermal->devdata;
+ struct armada_thermal_priv *priv = thermal_zone_device_priv(thermal);
int ret;
/* Valid check */
- if (!armada_is_valid(priv)) {
- dev_err(priv->dev,
- "Temperature sensor reading not valid\n");
+ if (!armada_is_valid(priv))
return -EIO;
- }
/* Do the actual reading */
ret = armada_read_sensor(priv, temp);
@@ -420,7 +414,7 @@ static struct thermal_zone_device_ops legacy_ops = {
static int armada_get_temp(struct thermal_zone_device *tz, int *temp)
{
- struct armada_thermal_sensor *sensor = tz->devdata;
+ struct armada_thermal_sensor *sensor = thermal_zone_device_priv(tz);
struct armada_thermal_priv *priv = sensor->priv;
int ret;