From: Linus Torvalds Date: Tue, 12 Jun 2018 20:23:51 +0000 (-0700) Subject: Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux... X-Git-Tag: v5.15~8617 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19785cf93b6c4252981894394f2dbd35c5e5d1ec;p=platform%2Fkernel%2Flinux-starfive.git Merge branch 'linus' of git://git./linux/kernel/git/evalenti/linux-soc-thermal Pull thermal SoC updates from Zhang Rui: "Thermal SoC management updates: - imx thermal driver now supports i.MX7 thermal sensor (Anson Huang) - exynos thermal driver dropped support for exynos 5440 (Krzysztof Kozlowski) - rcar_thermal now supports r8a77995 (Yoshihiro Kaneko) - rcar_gen3_thermal now supports r8a77965 (Niklas Söderlund) - qcom-spmi-temp-alarm now supports GEN2 PMIC peripherals (David Collins) - uniphier thermal now supports UniPhier PXs3 (Kunihiko Hayashi) - mediatek thermal now supports MT7622 SoC (Sean Wang) - considerable refactoring of exynos driver (Bartlomiej Zolnierkiewicz) - small fixes all over the place on different drivers" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: (50 commits) thermal: qcom: tsens: Allow number of sensors to come from DT thermal: tegra: soctherm: add const to struct thermal_cooling_device_ops thermal: exynos: Reduce severity of too early temperature read thermal: imx: Switch to SPDX identifier thermal: qcom-spmi-temp-alarm: add support for GEN2 PMIC peripherals thermal: ti-soc-thermal: fix incorrect entry in omap5430_adc_to_temp[] thermal: rcar_thermal: add r8a77995 support dt-bindings: thermal: rcar-thermal: add R8A77995 support thermal: mediatek: use of_device_get_match_data() thermal: exynos: remove trip reporting to user-space thermal: exynos: remove unused defines for Exynos5433 thermal: exynos: cleanup code for enabling threshold interrupts thermal: exynos: check return values of ->get_trip_[temp, hyst] methods thermal: exynos: move trips setting to exynos_tmu_initialize() thermal: exynos: set trips in ascending order in exynos7_tmu_initialize() thermal: exynos: do not use trips structure directly in ->tmu_initialize thermal: exynos: add exynos*_tmu_set_[trip,hyst]() helpers thermal: exynos: move IRQs clearing to exynos_tmu_initialize() thermal: exynos: clear IRQs later in exynos4412_tmu_initialize() thermal: exynos: make ->tmu_initialize method void ... --- 19785cf93b6c4252981894394f2dbd35c5e5d1ec diff --cc drivers/thermal/qcom/tsens.c index c2c3442,20f3b87..3440166 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@@ -134,9 -141,8 +140,9 @@@ static int tsens_probe(struct platform_ return -EINVAL; } - tmdev = devm_kzalloc(dev, sizeof(*tmdev) + - num_sensors * sizeof(*s), GFP_KERNEL); + tmdev = devm_kzalloc(dev, - struct_size(tmdev, sensor, data->num_sensors), ++ struct_size(tmdev, sensor, num_sensors), + GFP_KERNEL); if (!tmdev) return -ENOMEM; diff --cc drivers/thermal/samsung/exynos_tmu.c index ac83f72,c24969d7..a992e51 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@@ -894,8 -666,14 +666,14 @@@ static int exynos_get_temp(void *p, in struct exynos_tmu_data *data = p; int value, ret = 0; - if (!data || !data->tmu_read) + if (!data || !data->tmu_read || !data->enabled) return -EINVAL; + else if (!data->enabled) + /* + * Called too early, probably + * from thermal_zone_of_sensor_register(). + */ + return -EAGAIN; mutex_lock(&data->lock); clk_enable(data->clk);