The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/3] char: Remove redundant error messages on IRQ request failure
@ 2026-07-10 10:53 Pan Chuang
  2026-07-10 10:53 ` [PATCH 1/3] hwrng: drivers - Remove redundant dev_err()/dev_err_probe() Pan Chuang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Pan Chuang @ 2026-07-10 10:53 UTC (permalink / raw)
  To: Olivia Mackall, Herbert Xu, Hadar Gat, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jia Jie Ho, Deepak Saxena,
	Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, Eli Billauer,
	Arnd Bergmann, Greg Kroah-Hartman, Danilo Krummrich,
	Aleksander Jan Bajkowski, Takashi Sakamoto, Bjorn Helgaas,
	Pan Chuang, Uwe Kleine-König (The Capable Hub), Alper Ak,
	Stefano Garzarella,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE, open list,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:TPM DEVICE DRIVER

Commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()") added automatic error logging to
devm_request_threaded_irq() and devm_request_any_context_irq()
via the new devm_request_result() helper, which prints device
name, IRQ number, handler functions, and error code on failure.

Since devm_request_irq() is a static inline wrapper around
devm_request_threaded_irq(), it also benefits from this
automatic logging.

Remove the now-redundant dev_err() and dev_err_probe() calls
in char drivers that follow these devm_request_*_irq()
functions, as the core now provides more detailed diagnostic
information on failure.

Pan Chuang (3):
  hwrng: drivers - Remove redundant dev_err()/dev_err_probe()
  tpm: Remove redundant dev_err()
  char: xillybus: Remove redundant dev_err()

 drivers/char/hw_random/airoha-trng.c  | 4 +---
 drivers/char/hw_random/cctrng.c       | 2 +-
 drivers/char/hw_random/imx-rngc.c     | 2 +-
 drivers/char/hw_random/jh7110-trng.c  | 3 +--
 drivers/char/hw_random/omap-rng.c     | 5 +----
 drivers/char/hw_random/xgene-rng.c    | 2 +-
 drivers/char/tpm/st33zp24/st33zp24.c  | 5 +----
 drivers/char/tpm/tpm_i2c_nuvoton.c    | 2 --
 drivers/char/tpm/tpm_tis_i2c_cr50.c   | 4 +---
 drivers/char/xillybus/xillybus_of.c   | 5 +----
 drivers/char/xillybus/xillybus_pcie.c | 5 +----
 11 files changed, 10 insertions(+), 29 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] hwrng: drivers - Remove redundant dev_err()/dev_err_probe()
  2026-07-10 10:53 [PATCH 0/3] char: Remove redundant error messages on IRQ request failure Pan Chuang
@ 2026-07-10 10:53 ` Pan Chuang
  2026-07-10 10:53 ` [PATCH 2/3] tpm: Remove redundant dev_err() Pan Chuang
  2026-07-10 10:53 ` [PATCH 3/3] char: xillybus: " Pan Chuang
  2 siblings, 0 replies; 6+ messages in thread
From: Pan Chuang @ 2026-07-10 10:53 UTC (permalink / raw)
  To: Olivia Mackall, Herbert Xu, Hadar Gat, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jia Jie Ho, Deepak Saxena,
	Pan Chuang, Takashi Sakamoto, Bjorn Helgaas, Danilo Krummrich,
	Aleksander Jan Bajkowski, Uwe Kleine-König (The Capable Hub),
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE, open list,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() automatically logs
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>
---
 drivers/char/hw_random/airoha-trng.c | 4 +---
 drivers/char/hw_random/cctrng.c      | 2 +-
 drivers/char/hw_random/imx-rngc.c    | 2 +-
 drivers/char/hw_random/jh7110-trng.c | 3 +--
 drivers/char/hw_random/omap-rng.c    | 5 +----
 drivers/char/hw_random/xgene-rng.c   | 2 +-
 6 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/char/hw_random/airoha-trng.c b/drivers/char/hw_random/airoha-trng.c
index 076519a2f100..98c131ee9891 100644
--- a/drivers/char/hw_random/airoha-trng.c
+++ b/drivers/char/hw_random/airoha-trng.c
@@ -186,10 +186,8 @@ static int airoha_trng_probe(struct platform_device *pdev)
 	airoha_trng_irq_mask(trng);
 	ret = devm_request_irq(&pdev->dev, irq, airoha_trng_irq, 0,
 			       pdev->name, (void *)trng);
-	if (ret) {
-		dev_err(dev, "Can't get interrupt working.\n");
+	if (ret)
 		return ret;
-	}
 
 	init_completion(&trng->rng_op_done);
 
diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c
index a5be9258037f..a6925211c3b5 100644
--- a/drivers/char/hw_random/cctrng.c
+++ b/drivers/char/hw_random/cctrng.c
@@ -509,7 +509,7 @@ static int cctrng_probe(struct platform_device *pdev)
 	/* register the driver isr function */
 	rc = devm_request_irq(dev, irq, cc_isr, IRQF_SHARED, "cctrng", drvdata);
 	if (rc)
-		return dev_err_probe(dev, rc, "Could not register to interrupt %d\n", irq);
+		return rc;
 	dev_dbg(dev, "Registered to IRQ: %d\n", irq);
 
 	/* Clear all pending interrupts */
diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
index 28c56c2d1bf6..bae8cdca13fe 100644
--- a/drivers/char/hw_random/imx-rngc.c
+++ b/drivers/char/hw_random/imx-rngc.c
@@ -296,7 +296,7 @@ static int __init imx_rngc_probe(struct platform_device *pdev)
 			irq, imx_rngc_irq, 0, pdev->name, (void *)rngc);
 	if (ret) {
 		clk_disable_unprepare(rngc->clk);
-		return dev_err_probe(&pdev->dev, ret, "Can't get interrupt working.\n");
+		return ret;
 	}
 
 	if (self_test) {
diff --git a/drivers/char/hw_random/jh7110-trng.c b/drivers/char/hw_random/jh7110-trng.c
index 4712c3c530e4..aee12caab578 100644
--- a/drivers/char/hw_random/jh7110-trng.c
+++ b/drivers/char/hw_random/jh7110-trng.c
@@ -303,8 +303,7 @@ static int starfive_trng_probe(struct platform_device *pdev)
 	ret = devm_request_irq(&pdev->dev, irq, starfive_trng_irq, 0, pdev->name,
 			       (void *)trng);
 	if (ret)
-		return dev_err_probe(&pdev->dev, ret,
-				     "Failed to register interrupt handler\n");
+		return ret;
 
 	trng->hclk = devm_clk_get(&pdev->dev, "hclk");
 	if (IS_ERR(trng->hclk))
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 5e8b50f15db7..327643ba971c 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -391,11 +391,8 @@ static int of_get_omap_rng_device_details(struct omap_rng_dev *priv,
 
 		err = devm_request_irq(dev, irq, omap4_rng_irq,
 				       IRQF_TRIGGER_NONE, dev_name(dev), priv);
-		if (err) {
-			dev_err(dev, "unable to request irq %d, err = %d\n",
-				irq, err);
+		if (err)
 			return err;
-		}
 
 		/*
 		 * On OMAP4, enabling the shutdown_oflo interrupt is
diff --git a/drivers/char/hw_random/xgene-rng.c b/drivers/char/hw_random/xgene-rng.c
index 1f4b95341c2e..629dc85c3741 100644
--- a/drivers/char/hw_random/xgene-rng.c
+++ b/drivers/char/hw_random/xgene-rng.c
@@ -336,7 +336,7 @@ static int xgene_rng_probe(struct platform_device *pdev)
 	rc = devm_request_irq(&pdev->dev, ctx->irq, xgene_rng_irq_handler, 0,
 				dev_name(&pdev->dev), ctx);
 	if (rc)
-		return dev_err_probe(&pdev->dev, rc, "Could not request RNG alarm IRQ\n");
+		return rc;
 
 	/* Enable IP clock */
 	clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] tpm: Remove redundant dev_err()
  2026-07-10 10:53 [PATCH 0/3] char: Remove redundant error messages on IRQ request failure Pan Chuang
  2026-07-10 10:53 ` [PATCH 1/3] hwrng: drivers - Remove redundant dev_err()/dev_err_probe() Pan Chuang
@ 2026-07-10 10:53 ` Pan Chuang
  2026-07-11 17:37   ` Jarkko Sakkinen
  2026-07-10 10:53 ` [PATCH 3/3] char: xillybus: " Pan Chuang
  2 siblings, 1 reply; 6+ messages in thread
From: Pan Chuang @ 2026-07-10 10:53 UTC (permalink / raw)
  To: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, Stefano Garzarella,
	Alper Ak, Pan Chuang, open list:TPM DEVICE DRIVER, open list

Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() automatically logs
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() calls.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
---
 drivers/char/tpm/st33zp24/st33zp24.c | 5 +----
 drivers/char/tpm/tpm_i2c_nuvoton.c   | 2 --
 drivers/char/tpm/tpm_tis_i2c_cr50.c  | 4 +---
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c
index e2b7451ea7cc..8d5179367eac 100644
--- a/drivers/char/tpm/st33zp24/st33zp24.c
+++ b/drivers/char/tpm/st33zp24/st33zp24.c
@@ -506,11 +506,8 @@ int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops,
 		ret = devm_request_irq(dev, irq, tpm_ioserirq_handler,
 				IRQF_TRIGGER_HIGH, "TPM SERIRQ management",
 				chip);
-		if (ret < 0) {
-			dev_err(&chip->dev, "TPM SERIRQ signals %d not available\n",
-				irq);
+		if (ret < 0)
 			goto _tpm_clean_answer;
-		}
 
 		intmask |= TPM_INTF_CMD_READY_INT
 			|  TPM_INTF_STS_VALID_INT
diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c
index aa3673002f3a..c84afb29d548 100644
--- a/drivers/char/tpm/tpm_i2c_nuvoton.c
+++ b/drivers/char/tpm/tpm_i2c_nuvoton.c
@@ -576,8 +576,6 @@ static int i2c_nuvoton_probe(struct i2c_client *client)
 				      dev_name(&chip->dev),
 				      chip);
 		if (rc) {
-			dev_err(dev, "%s() Unable to request irq: %d for use\n",
-				__func__, priv->irq);
 			priv->irq = 0;
 		} else {
 			chip->flags |= TPM_CHIP_FLAG_IRQ;
diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c
index b48cacacc066..7f828fae70d3 100644
--- a/drivers/char/tpm/tpm_tis_i2c_cr50.c
+++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c
@@ -751,10 +751,8 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client)
 		rc = devm_request_irq(dev, client->irq, tpm_cr50_i2c_int_handler,
 				      IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN,
 				      dev->driver->name, chip);
-		if (rc < 0) {
-			dev_err(dev, "Failed to probe IRQ %d\n", client->irq);
+		if (rc < 0)
 			return rc;
-		}
 
 		priv->irq = client->irq;
 	} else {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] char: xillybus: Remove redundant dev_err()
  2026-07-10 10:53 [PATCH 0/3] char: Remove redundant error messages on IRQ request failure Pan Chuang
  2026-07-10 10:53 ` [PATCH 1/3] hwrng: drivers - Remove redundant dev_err()/dev_err_probe() Pan Chuang
  2026-07-10 10:53 ` [PATCH 2/3] tpm: Remove redundant dev_err() Pan Chuang
@ 2026-07-10 10:53 ` Pan Chuang
  2026-07-11 15:46   ` Eli Billauer
  2 siblings, 1 reply; 6+ messages in thread
From: Pan Chuang @ 2026-07-10 10:53 UTC (permalink / raw)
  To: Eli Billauer, Arnd Bergmann, Greg Kroah-Hartman,
	open list:XILLYBUS DRIVER
  Cc: Pan Chuang

Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() automatically logs
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() calls.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
---
 drivers/char/xillybus/xillybus_of.c   | 5 +----
 drivers/char/xillybus/xillybus_pcie.c | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/char/xillybus/xillybus_of.c b/drivers/char/xillybus/xillybus_of.c
index 1a1e64133315..46e1046abfca 100644
--- a/drivers/char/xillybus/xillybus_of.c
+++ b/drivers/char/xillybus/xillybus_of.c
@@ -55,11 +55,8 @@ static int xilly_drv_probe(struct platform_device *op)
 
 	rc = devm_request_irq(dev, irq, xillybus_isr, 0, xillyname, endpoint);
 
-	if (rc) {
-		dev_err(endpoint->dev,
-			"Failed to register IRQ handler. Aborting.\n");
+	if (rc)
 		return -ENODEV;
-	}
 
 	return xillybus_endpoint_discovery(endpoint);
 }
diff --git a/drivers/char/xillybus/xillybus_pcie.c b/drivers/char/xillybus/xillybus_pcie.c
index 9858711e3e79..32064b6c7627 100644
--- a/drivers/char/xillybus/xillybus_pcie.c
+++ b/drivers/char/xillybus/xillybus_pcie.c
@@ -83,11 +83,8 @@ static int xilly_probe(struct pci_dev *pdev,
 	}
 	rc = devm_request_irq(&pdev->dev, pdev->irq, xillybus_isr, 0,
 			      xillyname, endpoint);
-	if (rc) {
-		dev_err(endpoint->dev,
-			"Failed to register MSI handler. Aborting.\n");
+	if (rc)
 		return -ENODEV;
-	}
 
 	/*
 	 * Some (old and buggy?) hardware drops 64-bit addressed PCIe packets,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] char: xillybus: Remove redundant dev_err()
  2026-07-10 10:53 ` [PATCH 3/3] char: xillybus: " Pan Chuang
@ 2026-07-11 15:46   ` Eli Billauer
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Billauer @ 2026-07-11 15:46 UTC (permalink / raw)
  To: Pan Chuang, Arnd Bergmann, Greg Kroah-Hartman,
	open list:XILLYBUS DRIVER

On 10/07/2026 12:53, Pan Chuang wrote:
> Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
> devm_request_*_irq()"), devm_request_irq() automatically logs
> detailed error messages on failure. Remove the now-redundant
> driver-specific dev_err() calls.
> 
My opinion about error messages is the more the merrier, but I suppose 
this is part of a more general code cleanup. As this specific error 
message isn't expected to happen often, I have no reason to object.

Thanks & regards,
    Eli

Acked-by: Eli Billauer <eli.billauer@gmail.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] tpm: Remove redundant dev_err()
  2026-07-10 10:53 ` [PATCH 2/3] tpm: Remove redundant dev_err() Pan Chuang
@ 2026-07-11 17:37   ` Jarkko Sakkinen
  0 siblings, 0 replies; 6+ messages in thread
From: Jarkko Sakkinen @ 2026-07-11 17:37 UTC (permalink / raw)
  To: Pan Chuang
  Cc: Peter Huewe, Jason Gunthorpe, Stefano Garzarella, Alper Ak,
	open list:TPM DEVICE DRIVER, open list

On Fri, Jul 10, 2026 at 06:53:07PM +0800, Pan Chuang wrote:
> Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
> devm_request_*_irq()"), devm_request_irq() automatically logs
> detailed error messages on failure. Remove the now-redundant
> driver-specific dev_err() calls.
> 
> Signed-off-by: Pan Chuang <panchuang@vivo.com>


Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

Applied:  https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git/log/

> ---
>  drivers/char/tpm/st33zp24/st33zp24.c | 5 +----
>  drivers/char/tpm/tpm_i2c_nuvoton.c   | 2 --
>  drivers/char/tpm/tpm_tis_i2c_cr50.c  | 4 +---
>  3 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c
> index e2b7451ea7cc..8d5179367eac 100644
> --- a/drivers/char/tpm/st33zp24/st33zp24.c
> +++ b/drivers/char/tpm/st33zp24/st33zp24.c
> @@ -506,11 +506,8 @@ int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops,
>  		ret = devm_request_irq(dev, irq, tpm_ioserirq_handler,
>  				IRQF_TRIGGER_HIGH, "TPM SERIRQ management",
>  				chip);
> -		if (ret < 0) {
> -			dev_err(&chip->dev, "TPM SERIRQ signals %d not available\n",
> -				irq);
> +		if (ret < 0)
>  			goto _tpm_clean_answer;
> -		}
>  
>  		intmask |= TPM_INTF_CMD_READY_INT
>  			|  TPM_INTF_STS_VALID_INT
> diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c
> index aa3673002f3a..c84afb29d548 100644
> --- a/drivers/char/tpm/tpm_i2c_nuvoton.c
> +++ b/drivers/char/tpm/tpm_i2c_nuvoton.c
> @@ -576,8 +576,6 @@ static int i2c_nuvoton_probe(struct i2c_client *client)
>  				      dev_name(&chip->dev),
>  				      chip);
>  		if (rc) {
> -			dev_err(dev, "%s() Unable to request irq: %d for use\n",
> -				__func__, priv->irq);
>  			priv->irq = 0;
>  		} else {
>  			chip->flags |= TPM_CHIP_FLAG_IRQ;
> diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c
> index b48cacacc066..7f828fae70d3 100644
> --- a/drivers/char/tpm/tpm_tis_i2c_cr50.c
> +++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c
> @@ -751,10 +751,8 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client)
>  		rc = devm_request_irq(dev, client->irq, tpm_cr50_i2c_int_handler,
>  				      IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN,
>  				      dev->driver->name, chip);
> -		if (rc < 0) {
> -			dev_err(dev, "Failed to probe IRQ %d\n", client->irq);
> +		if (rc < 0)
>  			return rc;
> -		}
>  
>  		priv->irq = client->irq;
>  	} else {
> -- 
> 2.34.1
> 

BR, Jarkko

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-11 17:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 10:53 [PATCH 0/3] char: Remove redundant error messages on IRQ request failure Pan Chuang
2026-07-10 10:53 ` [PATCH 1/3] hwrng: drivers - Remove redundant dev_err()/dev_err_probe() Pan Chuang
2026-07-10 10:53 ` [PATCH 2/3] tpm: Remove redundant dev_err() Pan Chuang
2026-07-11 17:37   ` Jarkko Sakkinen
2026-07-10 10:53 ` [PATCH 3/3] char: xillybus: " Pan Chuang
2026-07-11 15:46   ` Eli Billauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox