Commit bbcf90c0 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Daniel Lezcano
Browse files

thermal: Explicitly enable non-changing thermal zone devices



Some thermal zone devices never change their state, so they should be
always enabled.

Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@collabora.com>
Reviewed-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200629122925.21729-9-andrzej.p@collabora.com
parent 7f4957be
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -92,6 +92,14 @@ int cxgb4_thermal_init(struct adapter *adap)
		ch_thermal->tzdev = NULL;
		return ret;
	}

	ret = thermal_zone_device_enable(ch_thermal->tzdev);
	if (ret) {
		dev_err(adap->pdev_dev, "Failed to enable thermal zone\n");
		thermal_zone_device_unregister(adap->ch_thermal.tzdev);
		return ret;
	}

	return 0;
}

+8 −1
Original line number Diff line number Diff line
@@ -733,7 +733,7 @@ static struct thermal_zone_device_ops tzone_ops = {

static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm)
{
	int i;
	int i, ret;
	char name[16];
	static atomic_t counter = ATOMIC_INIT(0);

@@ -759,6 +759,13 @@ static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm)
		return;
	}

	ret = thermal_zone_device_enable(mvm->tz_device.tzone);
	if (ret) {
		IWL_DEBUG_TEMP(mvm, "Failed to enable thermal zone\n");
		thermal_zone_device_unregister(mvm->tz_device.tzone);
		return;
	}

	/* 0 is a valid temperature,
	 * so initialize the array with S16_MIN which invalid temperature
	 */
+6 −0
Original line number Diff line number Diff line
@@ -493,6 +493,12 @@ static int mid_thermal_probe(struct platform_device *pdev)
			ret = PTR_ERR(pinfo->tzd[i]);
			goto err;
		}
		ret = thermal_zone_device_enable(pinfo->tzd[i]);
		if (ret) {
			kfree(td_info);
			thermal_zone_device_unregister(pinfo->tzd[i]);
			goto err;
		}
	}

	pinfo->pdev = pdev;
+7 −2
Original line number Diff line number Diff line
@@ -939,7 +939,7 @@ static struct thermal_zone_device_ops psy_tzd_ops = {

static int psy_register_thermal(struct power_supply *psy)
{
	int i;
	int i, ret;

	if (psy->desc->no_thermal)
		return 0;
@@ -949,7 +949,12 @@ static int psy_register_thermal(struct power_supply *psy)
		if (psy->desc->properties[i] == POWER_SUPPLY_PROP_TEMP) {
			psy->tzd = thermal_zone_device_register(psy->desc->name,
					0, 0, psy, &psy_tzd_ops, NULL, 0, 0);
			return PTR_ERR_OR_ZERO(psy->tzd);
			if (IS_ERR(psy->tzd))
				return PTR_ERR(psy->tzd);
			ret = thermal_zone_device_enable(psy->tzd);
			if (ret)
				thermal_zone_device_unregister(psy->tzd);
			return ret;
		}
	}
	return 0;
+6 −0
Original line number Diff line number Diff line
@@ -874,6 +874,12 @@ static int armada_thermal_probe(struct platform_device *pdev)
			return PTR_ERR(tz);
		}

		ret = thermal_zone_device_enable(tz);
		if (ret) {
			thermal_zone_device_unregister(tz);
			return ret;
		}

		drvdata->type = LEGACY;
		drvdata->data.tz = tz;
		platform_set_drvdata(pdev, drvdata);
Loading