Skip to content

Commit

Permalink
thermal: exynos: check return values of ->get_trip_[temp, hyst] methods
Browse files Browse the repository at this point in the history
Check return values of ->get_trip_[temp,hyst] methods in
exynos_tmu_initialize().

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Eduardo Valentin <[email protected]>
  • Loading branch information
bzolnier authored and Eduardo Valentin committed May 6, 2018
1 parent c8f8f76 commit 89335c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/thermal/samsung/exynos_tmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,19 +357,23 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
/* Write temperature code for rising and falling threshold */
for (i = 0; i < ntrips; i++) {
/* Write temperature code for rising threshold */
tzd->ops->get_trip_temp(tzd, i, &temp);
ret = tzd->ops->get_trip_temp(tzd, i, &temp);
if (ret)
goto err;
temp /= MCELSIUS;
data->tmu_set_trip_temp(data, i, temp);

/* Write temperature code for falling threshold */
tzd->ops->get_trip_hyst(tzd, i, &hyst);
ret = tzd->ops->get_trip_hyst(tzd, i, &hyst);
if (ret)
goto err;
hyst /= MCELSIUS;
data->tmu_set_trip_hyst(data, i, temp, hyst);
}

data->tmu_clear_irqs(data);
}

err:
clk_disable(data->clk);
mutex_unlock(&data->lock);
if (!IS_ERR(data->clk_sec))
Expand Down

0 comments on commit 89335c2

Please sign in to comment.