summaryrefslogtreecommitdiff
path: root/drivers/thermal/tegra/tegra-bpmp-thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/tegra/tegra-bpmp-thermal.c')
-rw-r--r--drivers/thermal/tegra/tegra-bpmp-thermal.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/thermal/tegra/tegra-bpmp-thermal.c b/drivers/thermal/tegra/tegra-bpmp-thermal.c
index eb84f0b9dc7c..0b7a1a1948cb 100644
--- a/drivers/thermal/tegra/tegra-bpmp-thermal.c
+++ b/drivers/thermal/tegra/tegra-bpmp-thermal.c
@@ -106,21 +106,22 @@ static void tz_device_update_work_fn(struct work_struct *work)
static void bpmp_mrq_thermal(unsigned int mrq, struct tegra_bpmp_channel *ch,
void *data)
{
- struct mrq_thermal_bpmp_to_host_request *req;
+ struct mrq_thermal_bpmp_to_host_request req;
struct tegra_bpmp_thermal *tegra = data;
+ size_t offset;
int i;
- req = (struct mrq_thermal_bpmp_to_host_request *)ch->ib->data;
+ offset = offsetof(struct tegra_bpmp_mb_data, data);
+ iosys_map_memcpy_from(&req, &ch->ib, offset, sizeof(req));
- if (req->type != CMD_THERMAL_HOST_TRIP_REACHED) {
- dev_err(tegra->dev, "%s: invalid request type: %d\n",
- __func__, req->type);
+ if (req.type != CMD_THERMAL_HOST_TRIP_REACHED) {
+ dev_err(tegra->dev, "%s: invalid request type: %d\n", __func__, req.type);
tegra_bpmp_mrq_return(ch, -EINVAL, NULL, 0);
return;
}
for (i = 0; i < tegra->num_zones; ++i) {
- if (tegra->zones[i]->idx != req->host_trip_reached.zone)
+ if (tegra->zones[i]->idx != req.host_trip_reached.zone)
continue;
schedule_work(&tegra->zones[i]->tz_device_update_work);
@@ -129,7 +130,7 @@ static void bpmp_mrq_thermal(unsigned int mrq, struct tegra_bpmp_channel *ch,
}
dev_err(tegra->dev, "%s: invalid thermal zone: %d\n", __func__,
- req->host_trip_reached.zone);
+ req.host_trip_reached.zone);
tegra_bpmp_mrq_return(ch, -EINVAL, NULL, 0);
}