summaryrefslogtreecommitdiff
path: root/drivers/thermal/imx_sc_thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/imx_sc_thermal.c')
-rw-r--r--drivers/thermal/imx_sc_thermal.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c
index f32e59e74623..839bb9958f60 100644
--- a/drivers/thermal/imx_sc_thermal.c
+++ b/drivers/thermal/imx_sc_thermal.c
@@ -46,7 +46,7 @@ static int imx_sc_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
{
struct imx_sc_msg_misc_get_temp msg;
struct imx_sc_rpc_msg *hdr = &msg.hdr;
- struct imx_sc_sensor *sensor = tz->devdata;
+ struct imx_sc_sensor *sensor = thermal_zone_device_priv(tz);
int ret;
msg.data.req.resource_id = sensor->resource_id;
@@ -58,11 +58,8 @@ static int imx_sc_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
hdr->size = 2;
ret = imx_scu_call_rpc(thermal_ipc_handle, &msg, true);
- if (ret) {
- dev_err(&sensor->tzd->device, "read temp sensor %d failed, ret %d\n",
- sensor->resource_id, ret);
+ if (ret)
return ret;
- }
*temp = msg.data.resp.celsius * 1000 + msg.data.resp.tenths * 100;
@@ -119,7 +116,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)
return ret;
}
- if (devm_thermal_add_hwmon_sysfs(sensor->tzd))
+ if (devm_thermal_add_hwmon_sysfs(&pdev->dev, sensor->tzd))
dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
}