lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250623123743.473677-1-panchuang@vivo.com>
Date: Mon, 23 Jun 2025 20:37:40 +0800
From: Pan Chuang <panchuang@...o.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Zhang Rui <rui.zhang@...el.com>,
	Lukasz Luba <lukasz.luba@....com>,
	Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Greg KH <gregkh@...uxfoundation.org>,
	linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Yangtao Li <frank.li@...o.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Krzysztof Kozlowski <krzk@...nel.org>,
	Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
	Jonathan Cameron <Jonathan.Cameron@...wei.com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Pan Chuang <panchuang@...o.com>
Subject: [PATCH v6 10/24] thermal: intel: int340x: processor_thermal: convert to use devm_request*_irq_probe()

From: Yangtao Li <frank.li@...o.com>

The new devm_request_*irq_probe API prints an error message by default
when the request fails, and consumers can provide custom error messages.

Converting drivers to use this API has the following benefits:

  1.More than 2,000 lines of code can be saved by removing redundant error
  messages in drivers.

  2.Upper-layer functions can directly return error codes without missing
  debugging information.

  3.Having proper and consistent information about why the device cannot
  be used is useful.

Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Krzysztof Kozlowski <krzk@...nel.org>
Cc: "Uwe Kleine-König" <u.kleine-koenig@...gutronix.de>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: AngeloGioacchino Del Regno  <angelogioacchino.delregno@...labora.com>
Signed-off-by: Yangtao Li <frank.li@...o.com>
Acked-by: Rafael J. Wysocki <rafael@...nel.org>
Signed-off-by: Pan Chuang <panchuang@...o.com>
---
 .../processor_thermal_device_pci.c            | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
index 00160936070a..d3e3a53511c4 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
@@ -305,13 +305,13 @@ static int proc_thermal_setup_msi(struct pci_dev *pdev, struct proc_thermal_pci
 	for (i = 0; i < count; i++) {
 		irq =  pci_irq_vector(pdev, i);
 
-		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);
+		ret = devm_request_threaded_irq_probe(&pdev->dev, irq,
+						      proc_thermal_irq_handler,
+						      proc_thermal_irq_thread_handler,
+						      0, KBUILD_MODNAME,
+						      pci_info, NULL);
+		if (ret)
 			goto err_free_msi_vectors;
-		}
 
 		proc_thermal_msi_map[i] = irq;
 	}
@@ -391,13 +391,13 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device_
 		irq_flag = IRQF_SHARED;
 		irq = pdev->irq;
 
-		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);
+		ret = devm_request_threaded_irq_probe(&pdev->dev, irq,
+						      proc_thermal_irq_handler,
+						      proc_thermal_irq_thread_handler,
+						      irq_flag, KBUILD_MODNAME,
+						      pci_info, NULL);
+		if (ret)
 			goto err_ret_tzone;
-		}
 	}
 
 	ret = thermal_zone_device_enable(pci_info->tzone);
-- 
2.39.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ