From 6eb61a9361951e466628bcb0abaf0a197181ec97 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Sun, 21 Apr 2019 16:45:11 +0800 Subject: thermal/int3403_thermal: favor _TMP instead of PTYP All the INT3403 devices with _TMP can be a sensor. Link: https://bugzilla.kernel.org/show_bug.cgi?id=202671 Signed-off-by: Zhang Rui --- drivers/thermal/intel/int340x_thermal/int3403_thermal.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/thermal/intel') diff --git a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c index 0c19fcd56a0d..79a7df2baa92 100644 --- a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c @@ -220,6 +220,7 @@ static int int3403_add(struct platform_device *pdev) { struct int3403_priv *priv; int result = 0; + unsigned long long tmp; acpi_status status; priv = devm_kzalloc(&pdev->dev, sizeof(struct int3403_priv), @@ -234,19 +235,18 @@ static int int3403_add(struct platform_device *pdev) goto err; } - status = acpi_evaluate_integer(priv->adev->handle, "PTYP", - NULL, &priv->type); - if (ACPI_FAILURE(status)) { - unsigned long long tmp; - status = acpi_evaluate_integer(priv->adev->handle, "_TMP", - NULL, &tmp); + status = acpi_evaluate_integer(priv->adev->handle, "_TMP", + NULL, &tmp); + if (ACPI_FAILURE(status)) { + status = acpi_evaluate_integer(priv->adev->handle, "PTYP", + NULL, &priv->type); if (ACPI_FAILURE(status)) { result = -EINVAL; goto err; - } else { - priv->type = INT3403_TYPE_SENSOR; } + } else { + priv->type = INT3403_TYPE_SENSOR; } platform_set_drvdata(pdev, priv); -- cgit v1.2.3 From 1948d498dcf680bc650391f23da2f97e59f9126d Mon Sep 17 00:00:00 2001 From: Sumeet Pawnikar Date: Mon, 15 Apr 2019 20:18:30 +0530 Subject: thermal: intel: int340x: processor_thermal_device: simplify to get driver data This simplifies getting the 'driver_data' from 'struct device' directly. Going through platform_device or pci_dev is not required. Also removes condition check as the private data stored with dev pointer, means irrespective of enumeration mode, we can use dev_get_drvdata(). This removes the unnecessary step back and forth. Signed-off-by: Sumeet Pawnikar Reviewed-by: Andy Shevchenko Signed-off-by: Zhang Rui --- .../thermal/intel/int340x_thermal/processor_thermal_device.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'drivers/thermal/intel') diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c index 8e1cf4d789be..2a7cbaa1712d 100644 --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c @@ -81,22 +81,13 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \ struct device_attribute *attr, \ char *buf) \ { \ - struct pci_dev *pci_dev; \ - struct platform_device *pdev; \ - struct proc_thermal_device *proc_dev; \ + struct proc_thermal_device *proc_dev = dev_get_drvdata(dev); \ \ if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \ dev_warn(dev, "Attempted to get power limit before device was initialized!\n"); \ return 0; \ } \ \ - if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \ - pdev = to_platform_device(dev); \ - proc_dev = platform_get_drvdata(pdev); \ - } else { \ - pci_dev = to_pci_dev(dev); \ - proc_dev = pci_get_drvdata(pci_dev); \ - } \ return sprintf(buf, "%lu\n",\ (unsigned long)proc_dev->power_limits[index].suffix * 1000); \ } -- cgit v1.2.3 From e9cf125bc1f99caacd1f4700b2c78659c53c4d9d Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Tue, 2 Apr 2019 18:12:48 +0200 Subject: thermal/drivers/core: Remove depends on THERMAL in Kconfig The dependency on the THERMAL option to be set is already there implicitly by the "if THERMAL" conditionnal option. The sub Kconfigs do not have to check against the THERMAL option as they are called from a Kconfig block which is enabled by the conditionnal option. Remove the useless "depends on THERMAL" in the Kconfigs. Signed-off-by: Daniel Lezcano Signed-off-by: Zhang Rui --- drivers/thermal/Kconfig | 2 -- drivers/thermal/intel/Kconfig | 1 - drivers/thermal/qcom/Kconfig | 1 - 3 files changed, 4 deletions(-) (limited to 'drivers/thermal/intel') diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index ccf5b9408d7a..d8aa7fac8c56 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -24,7 +24,6 @@ config THERMAL_STATISTICS config THERMAL_EMERGENCY_POWEROFF_DELAY_MS int "Emergency poweroff delay in milli-seconds" - depends on THERMAL default 0 help Thermal subsystem will issue a graceful shutdown when @@ -152,7 +151,6 @@ config CPU_THERMAL bool "generic cpu cooling support" depends on CPU_FREQ depends on THERMAL_OF - depends on THERMAL=y help This implements the generic cpu cooling mechanism through frequency reduction. An ACPI version of this already exists diff --git a/drivers/thermal/intel/Kconfig b/drivers/thermal/intel/Kconfig index 2e013eeb4a1d..2c727a820759 100644 --- a/drivers/thermal/intel/Kconfig +++ b/drivers/thermal/intel/Kconfig @@ -1,6 +1,5 @@ config INTEL_POWERCLAMP tristate "Intel PowerClamp idle injection driver" - depends on THERMAL depends on X86 depends on CPU_SUP_INTEL help diff --git a/drivers/thermal/qcom/Kconfig b/drivers/thermal/qcom/Kconfig index cdb455ffd575..3ce20fec86a2 100644 --- a/drivers/thermal/qcom/Kconfig +++ b/drivers/thermal/qcom/Kconfig @@ -1,6 +1,5 @@ config QCOM_TSENS tristate "Qualcomm TSENS Temperature Alarm" - depends on THERMAL depends on QCOM_QFPROM depends on ARCH_QCOM || COMPILE_TEST help -- cgit v1.2.3 From 44c0c23725a16c8803b8809b87651405e8741e4d Mon Sep 17 00:00:00 2001 From: Srinivas Pandruvada Date: Mon, 29 Apr 2019 20:42:13 -0700 Subject: drivers: thermal: processor_thermal: Downgrade error message Downgrade "Unsupported event" message from dev_err to dev_dbg. Otherwise it floods with this message one some platforms. Signed-off-by: Srinivas Pandruvada Signed-off-by: Zhang Rui --- drivers/thermal/intel/int340x_thermal/processor_thermal_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/thermal/intel') diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c index 2a7cbaa1712d..2e6071a82da2 100644 --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c @@ -265,7 +265,7 @@ static void proc_thermal_notify(acpi_handle handle, u32 event, void *data) THERMAL_DEVICE_POWER_CAPABILITY_CHANGED); break; default: - dev_err(proc_priv->dev, "Unsupported event [0x%x]\n", event); + dev_dbg(proc_priv->dev, "Unsupported event [0x%x]\n", event); break; } } -- cgit v1.2.3