genirq/devres: Add error handling in devm_request_*_irq()
authorPan Chuang <panchuang@vivo.com>
Tue, 5 Aug 2025 09:29:22 +0000 (17:29 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 24 Aug 2025 11:00:45 +0000 (13:00 +0200)
commit55b48e23f5c4b6f5ca9b7ab09599b17dcf501c10
tree347a5d8aa19568ca6f48b322f2136d1391745317
parent7a721a2fee2bce01af26699a87739db8ca8ea3c8
genirq/devres: Add error handling in devm_request_*_irq()

devm_request_threaded_irq() and devm_request_any_context_irq() currently
don't print any error message when interrupt registration fails.

This forces each driver to implement redundant error logging - over 2,000
lines of error messages exist across drivers. Additionally, when
upper-layer functions propagate these errors without logging, critical
debugging information is lost.

Add devm_request_result() helper to unify error reporting via dev_err_probe(),

Use it in devm_request_threaded_irq() and devm_request_any_context_irq()
printing device name, IRQ number, handler functions, and error code on failure
automatically.

Co-developed-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250805092922.135500-2-panchuang@vivo.com
kernel/irq/devres.c