mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 10:31:33 -04:00
thermal/drivers: Remove redundant error messages on IRQ request failure
Since commit 55b48e23f5 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq()
automatically log detailed error messages on failure. Remove the
now-redundant driver-specific dev_err() and dev_err_probe() calls.
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20260717024733.374913-1-panchuang@vivo.com
This commit is contained in:
committed by
Daniel Lezcano
parent
68b78ad1e3
commit
55c16e15ff
@@ -574,10 +574,8 @@ static int en7581_thermal_probe(struct platform_device *pdev,
|
||||
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
|
||||
en7581_thermal_irq, IRQF_ONESHOT,
|
||||
pdev->name, priv);
|
||||
if (ret) {
|
||||
dev_err(dev, "Can't get interrupt working.\n");
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
en7581_thermal_setup_monitor(priv);
|
||||
en7581_thermal_setup_adc_val(dev, priv);
|
||||
|
||||
@@ -900,11 +900,8 @@ static int armada_thermal_probe(struct platform_device *pdev)
|
||||
armada_overheat_isr,
|
||||
armada_overheat_isr_thread,
|
||||
0, NULL, priv);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Cannot request threaded IRQ %d\n",
|
||||
irq);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -356,8 +356,7 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
|
||||
IRQF_ONESHOT,
|
||||
DRV_NAME, priv);
|
||||
if (ret < 0)
|
||||
return dev_err_probe(&pdev->dev, ret,
|
||||
"could not request IRQ\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
dev_info(&pdev->dev, "registered AVS TMON of-sensor driver\n");
|
||||
|
||||
@@ -167,10 +167,8 @@ static int db8500_thermal_probe(struct platform_device *pdev)
|
||||
ret = devm_request_threaded_irq(dev, low_irq, NULL,
|
||||
prcmu_low_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
|
||||
"dbx500_temp_low", th);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "failed to allocate temp low irq\n");
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
high_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_HIGH");
|
||||
if (high_irq < 0)
|
||||
@@ -179,10 +177,8 @@ static int db8500_thermal_probe(struct platform_device *pdev)
|
||||
ret = devm_request_threaded_irq(dev, high_irq, NULL,
|
||||
prcmu_high_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
|
||||
"dbx500_temp_high", th);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "failed to allocate temp high irq\n");
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* register of thermal sensor and get info from DT */
|
||||
th->tz = devm_thermal_of_zone_register(dev, 0, th, &thdev_ops);
|
||||
|
||||
@@ -578,10 +578,8 @@ static int hisi_thermal_probe(struct platform_device *pdev)
|
||||
hisi_thermal_alarm_irq_thread,
|
||||
IRQF_ONESHOT, sensor->irq_name,
|
||||
sensor);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to request alarm irq: %d\n", ret);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = data->ops->enable_sensor(sensor);
|
||||
if (ret) {
|
||||
|
||||
@@ -331,7 +331,7 @@ static int imx91_tmu_probe(struct platform_device *pdev)
|
||||
IRQF_ONESHOT, "imx91_thermal", tmu);
|
||||
|
||||
if (ret < 0)
|
||||
return dev_err_probe(dev, ret, "failed to request alarm irq\n");
|
||||
return ret;
|
||||
|
||||
pm_runtime_put(dev);
|
||||
|
||||
|
||||
@@ -732,10 +732,8 @@ static int imx_thermal_probe(struct platform_device *pdev)
|
||||
ret = devm_request_threaded_irq(dev, data->irq,
|
||||
imx_thermal_alarm_irq, imx_thermal_alarm_irq_thread,
|
||||
0, "imx_thermal", data);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "failed to request alarm irq: %d\n", ret);
|
||||
if (ret < 0)
|
||||
goto thermal_zone_unregister;
|
||||
}
|
||||
|
||||
pm_runtime_put(data->dev);
|
||||
|
||||
|
||||
@@ -308,10 +308,8 @@ static int proc_thermal_setup_msi(struct pci_dev *pdev, struct proc_thermal_pci
|
||||
ret = devm_request_threaded_irq(&pdev->dev, irq, proc_thermal_irq_handler,
|
||||
proc_thermal_irq_thread_handler,
|
||||
0, KBUILD_MODNAME, pci_info);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Request IRQ %d failed\n", irq);
|
||||
if (ret)
|
||||
goto err_free_msi_vectors;
|
||||
}
|
||||
|
||||
proc_thermal_msi_map[i] = irq;
|
||||
}
|
||||
@@ -394,10 +392,8 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device_
|
||||
ret = devm_request_threaded_irq(&pdev->dev, irq, proc_thermal_irq_handler,
|
||||
proc_thermal_irq_thread_handler, irq_flag,
|
||||
KBUILD_MODNAME, pci_info);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Request IRQ %d failed\n", pdev->irq);
|
||||
if (ret)
|
||||
goto err_ret_tzone;
|
||||
}
|
||||
}
|
||||
|
||||
ret = thermal_zone_device_enable(pci_info->tzone);
|
||||
|
||||
@@ -245,10 +245,8 @@ static int pmic_thermal_probe(struct platform_device *pdev)
|
||||
NULL, pmic_thermal_irq_handler,
|
||||
IRQF_ONESHOT, "pmic_thermal", pdev);
|
||||
|
||||
if (ret) {
|
||||
dev_err(dev, "request irq(%d) failed: %d\n", virq, ret);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
pmic_irq_count++;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ static int loongson2_thermal_probe(struct platform_device *pdev)
|
||||
ret = devm_request_threaded_irq(dev, irq, NULL, loongson2_thermal_irq_thread,
|
||||
IRQF_ONESHOT, "loongson2_thermal", tzd);
|
||||
if (ret < 0)
|
||||
return dev_err_probe(dev, ret, "failed to request alarm irq\n");
|
||||
return ret;
|
||||
|
||||
devm_thermal_add_hwmon_sysfs(dev, tzd);
|
||||
|
||||
|
||||
@@ -121,19 +121,15 @@ static int max77620_thermal_probe(struct platform_device *pdev)
|
||||
max77620_thermal_irq,
|
||||
IRQF_ONESHOT | IRQF_SHARED,
|
||||
dev_name(&pdev->dev), mtherm);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Failed to request irq1: %d\n", ret);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = devm_request_threaded_irq(&pdev->dev, mtherm->irq_tjalarm2, NULL,
|
||||
max77620_thermal_irq,
|
||||
IRQF_ONESHOT | IRQF_SHARED,
|
||||
dev_name(&pdev->dev), mtherm);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Failed to request irq2: %d\n", ret);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1504,7 +1504,7 @@ static int lvts_probe(struct platform_device *pdev)
|
||||
ret = devm_request_threaded_irq(dev, irq, NULL, lvts_irq_handler,
|
||||
IRQF_ONESHOT, dev_name(dev), lvts_td);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Failed to request interrupt\n");
|
||||
return ret;
|
||||
|
||||
platform_set_drvdata(pdev, lvts_td);
|
||||
|
||||
|
||||
@@ -223,7 +223,6 @@ static int lmh_probe(struct platform_device *pdev)
|
||||
IRQF_NO_THREAD | IRQF_NO_SUSPEND,
|
||||
"lmh-irq", lmh_data);
|
||||
if (ret) {
|
||||
dev_err(dev, "Error %d registering irq %x\n", ret, lmh_data->irq);
|
||||
irq_domain_remove(lmh_data->domain);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1258,10 +1258,7 @@ static int tsens_register_irq(struct tsens_priv *priv, char *irqname,
|
||||
dev_name(&pdev->dev),
|
||||
priv);
|
||||
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "%s: failed to get irq\n",
|
||||
__func__);
|
||||
else
|
||||
if (!ret)
|
||||
*irq_num = irq;
|
||||
}
|
||||
|
||||
|
||||
@@ -446,10 +446,8 @@ static int rcar_thermal_probe(struct platform_device *pdev)
|
||||
|
||||
ret = devm_request_irq(dev, irq, rcar_thermal_irq,
|
||||
IRQF_SHARED, dev_name(dev), common);
|
||||
if (ret) {
|
||||
dev_err(dev, "irq request failed\n");
|
||||
if (ret)
|
||||
goto error_unregister;
|
||||
}
|
||||
|
||||
/* update ENR bits */
|
||||
if (chip->irq_per_ch)
|
||||
|
||||
@@ -461,10 +461,8 @@ static int rzg3e_thermal_probe(struct platform_device *pdev)
|
||||
ret = devm_request_threaded_irq(dev, irq, rzg3e_thermal_irq,
|
||||
rzg3e_thermal_irq_thread,
|
||||
IRQF_ONESHOT, "rzg3e_thermal", priv);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to request IRQ: %d\n", ret);
|
||||
if (ret)
|
||||
goto err_pm_put;
|
||||
}
|
||||
|
||||
/* Add hwmon sysfs interface */
|
||||
ret = devm_thermal_add_hwmon_sysfs(dev, priv->zone);
|
||||
|
||||
@@ -1773,8 +1773,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
|
||||
IRQF_ONESHOT,
|
||||
"rockchip_thermal", thermal);
|
||||
if (error)
|
||||
return dev_err_probe(&pdev->dev, error,
|
||||
"failed to request tsadc irq.\n");
|
||||
return error;
|
||||
|
||||
thermal->chip->control(thermal->regs, true);
|
||||
|
||||
|
||||
@@ -1102,10 +1102,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
|
||||
IRQF_TRIGGER_RISING
|
||||
| IRQF_SHARED | IRQF_ONESHOT,
|
||||
dev_name(dev), data);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to request irq: %d\n", data->irq);
|
||||
if (ret)
|
||||
goto err_sclk;
|
||||
}
|
||||
|
||||
exynos_tmu_control(pdev, true);
|
||||
return 0;
|
||||
|
||||
@@ -101,10 +101,8 @@ static int st_mmap_register_enable_irq(struct st_thermal_sensor *sensor)
|
||||
NULL, st_mmap_thermal_trip_handler,
|
||||
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
|
||||
dev->driver->name, sensor);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to register IRQ %d\n", sensor->irq);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return st_mmap_enable_irq(sensor);
|
||||
}
|
||||
|
||||
@@ -390,11 +390,8 @@ static int stm_register_irq(struct stm_thermal_sensor *sensor)
|
||||
stm_thermal_irq_handler,
|
||||
IRQF_ONESHOT,
|
||||
dev->driver->name, sensor);
|
||||
if (ret) {
|
||||
dev_err(dev, "%s: Failed to register IRQ %d\n", __func__,
|
||||
sensor->irq);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
dev_dbg(dev, "%s: thermal IRQ registered", __func__);
|
||||
|
||||
|
||||
@@ -2007,10 +2007,8 @@ static int soctherm_interrupts_init(struct platform_device *pdev,
|
||||
IRQF_ONESHOT,
|
||||
dev_name(&pdev->dev),
|
||||
tegra);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "request_irq 'thermal_irq' failed.\n");
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = devm_request_threaded_irq(&pdev->dev,
|
||||
tegra->edp_irq,
|
||||
@@ -2019,10 +2017,8 @@ static int soctherm_interrupts_init(struct platform_device *pdev,
|
||||
IRQF_ONESHOT,
|
||||
"soctherm_edp",
|
||||
tegra);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "request_irq 'edp_irq' failed.\n");
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -602,8 +602,7 @@ static int tegra_tsensor_probe(struct platform_device *pdev)
|
||||
tegra_tsensor_isr, IRQF_ONESHOT,
|
||||
"tegra_tsensor", ts);
|
||||
if (err)
|
||||
return dev_err_probe(&pdev->dev, err,
|
||||
"failed to request interrupt\n");
|
||||
return err;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
12
drivers/thermal/thermal-fw.c
Normal file
12
drivers/thermal/thermal-fw.c
Normal file
@@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* of-thermal-testing.c - Generic Thermal Management device tree testing support
|
||||
*
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/fwnode.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
|
||||
|
||||
97
drivers/thermal/thermal_fw.c
Normal file
97
drivers/thermal/thermal_fw.c
Normal file
@@ -0,0 +1,97 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* thermal-fw.c - Thermal components creation from firmware description
|
||||
*
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
#include <linux/fwnode.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/thermal.h>
|
||||
|
||||
/**
|
||||
* thermal_fwnode_cooling_device_register() - register an thermal cooling device
|
||||
* @np: a pointer to a device tree node.
|
||||
* @of_index: a cooling device index in the cooling controller
|
||||
* @type: the thermal cooling device type.
|
||||
* @devdata: device private data.
|
||||
* @ops: standard thermal cooling devices callbacks.
|
||||
*
|
||||
* This function will register a cooling device with device tree node reference.
|
||||
* This interface function adds a new thermal cooling device (fan/processor/...)
|
||||
* to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
|
||||
* to all the thermal zone devices registered at the same time.
|
||||
*
|
||||
* Return: a pointer to the created struct thermal_cooling_device or an
|
||||
* ERR_PTR. Caller must check return value with IS_ERR*() helpers.
|
||||
*/
|
||||
struct thermal_cooling_device *
|
||||
thermal_fwnode_cooling_device_register(struct fwnode_handle *fwnode, int fwn_index,
|
||||
const char *type, void *devdata,
|
||||
const struct thermal_cooling_device_ops *ops)
|
||||
{
|
||||
struct thermal_cooling_device *cdev;
|
||||
|
||||
cdev = __thermal_cooling_device_register(type, devdata, ops);
|
||||
if (IS_ERR(cdev))
|
||||
return cdev;
|
||||
|
||||
cdev->np = (struct device_node *)fwnode;
|
||||
cdev->of_index = fwn_index;
|
||||
thermal_cooling_device_init_complete(cdev);
|
||||
|
||||
return cdev;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(thermal_fwnode_cooling_device_register);
|
||||
|
||||
static struct thermal_cooling_device *
|
||||
__devm_thermal_fwnode_cooling_device_register(struct device *dev, struct fwnode_handle *fwnode,
|
||||
int fwn_index, const char *type, void *devdata,
|
||||
const struct thermal_cooling_device_ops *ops)
|
||||
{
|
||||
struct thermal_cooling_device **ptr, *tcd;
|
||||
|
||||
ptr = devres_alloc(thermal_cooling_device_release, sizeof(*ptr),
|
||||
GFP_KERNEL);
|
||||
if (!ptr)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
tcd = thermal_fwnode_cooling_device_register(fwnode, fwn_index, type, devdata, ops);
|
||||
if (IS_ERR(tcd)) {
|
||||
devres_free(ptr);
|
||||
return tcd;
|
||||
}
|
||||
|
||||
*ptr = tcd;
|
||||
devres_add(dev, ptr);
|
||||
|
||||
return tcd;
|
||||
}
|
||||
|
||||
/**
|
||||
* devm_thermal_fwnode_cooling_device_register() - register a thermal cooling device
|
||||
* @dev: a valid struct device pointer of a sensor device.
|
||||
* @fw_index: a cooling device index in the cooling controller
|
||||
* @type: the thermal cooling device type.
|
||||
* @devdata: device private data.
|
||||
* @ops: standard thermal cooling devices callbacks.
|
||||
*
|
||||
* This function will register a cooling device with a firmware node reference.
|
||||
* This interface function adds a new thermal cooling device (fan/processor/...)
|
||||
* to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
|
||||
* to all the thermal zone devices registered at the same time.
|
||||
*
|
||||
* Return: a pointer to the created struct thermal_cooling_device or an
|
||||
* ERR_PTR. Caller must check return value with IS_ERR*() helpers.
|
||||
*/
|
||||
struct thermal_cooling_device *
|
||||
devm_thermal_fwnode_cooling_device_register(struct device *dev, int fwn_index,
|
||||
const char *type, void *devdata,
|
||||
const struct thermal_cooling_device_ops *ops)
|
||||
{
|
||||
return __devm_thermal_fwnode_cooling_device_register(dev, dev_fwnode(dev), fwn_index,
|
||||
type, devdata, ops);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devm_thermal_fwnode_cooling_device_register);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user