[PATCH v6 01/24] genirq/devres: Add devm_request_threaded_irq_probe() and devm_request_irq_probe()
Miquel Raynal
miquel.raynal at bootlin.com
Mon Jun 23 08:13:54 PDT 2025
Hi Pan,
On 23/06/2025 at 20:30:34 +08, Pan Chuang <panchuang at vivo.com> wrote:
> From: Yangtao Li <frank.li at vivo.com>
>
> There are more than 700 calls to devm_request_threaded_irq method and
> more than 1000 calls to devm_request_irq method. Most drivers only
> request one interrupt resource, and these error messages are basically
> the same. If error messages are printed everywhere, more than 2000 lines
> of code can be saved by removing the msg in the driver.
[...]
> So add devm_request_threaded_irq_probe() and devm_request_irq_probe(),
> which ensure that all error handling branches print error information.
> In this way, when this function fails, the upper-layer functions can
> directly return an error code without missing debugging information.
> Otherwise, the error message will be printed redundantly or missing.
While I understand the goal and adhere to it, may I challenge the use of
a yet another intermediate function that 99% of the users will anyway
use? Wouldn't it be more straightforward to just add the error message
in the existing functions directly? If we really want an alternative, it
may be created and called in the few places where a dev_err_probe()
might not be relevant.
Thanks,
Miquèl
More information about the Linux-mediatek
mailing list