Re: [PATCH v3] serial: mps2-uart: Check for error irq
From: Robin Murphy <robin.murphy@arm.com>
Date: 2021-12-23 14:26:20
Also in:
linux-serial, lkml
On 2021-12-23 13:27, Jiasheng Jiang wrote:
On 2021-12-23 12:54, Robin Murphy wrote:quoted
quoted
Because of the possible failure of the platform_get_irq(), it should be better to check it to avoid the use of error irq.As far as I can see, the only "use" of error values is that they will be passed to request_irq(), which will then return -EINVAL because they are not valid IRQ numbers, and that error will be handled appropriately. I think that's a relatively common pattern, so your commit message should really describe why you think it's a problem and why this addition is a meaningful improvement.Thanks for your reminder, and I correct my commit message as follow. If that's ok, I will correct my other patches like this. For the possible failure of the platform_get_irq(), the returned irq could be error number and will finally cause the failure of the request_irq(). So it might be better to check just now in order to avoid the waste of later processes.
Even better, consider that platform_get_irq() can now in certain cases return -EPROBE_DEFER, and the consequences of letting request_irq() effectively convert that into -EINVAL, even at probe time rather than later on ;) Cheers, Robin.
Sincerely thanks, Jiasheng
_______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel