Thread (92 messages) 92 messages, 12 authors, 2022-01-25

Re: [PATCH 1/2] platform: make platform_get_irq_optional() optional

From: Sergey Shtylyov <hidden>
Date: 2022-01-19 18:29:44
Also in: alsa-devel, kvm, linux-edac, linux-gpio, linux-i2c, linux-iio, linux-mediatek, linux-mmc, linux-phy, linux-pm, linux-pwm, linux-renesas-soc, linux-serial, linux-spi, lkml, platform-driver-x86

On 1/19/22 7:12 PM, Sergey Shtylyov wrote:

[...]
quoted
quoted
So there's still a need for two functions.
Or a single function not emitting an error message together with the
callers being responsible for calling dev_err().

So the options in my preference order (first is best) are:

 - Remove the printk from platform_get_irq() and remove
   platform_get_irq_optional();
   Strong NAK here:
- dev_err() in our function saves a lot of (repeatable!) comments;
   s/comments/code/.
   Actually, I think I can accept the removal of dev_err_probe() in platform_get_irq()
as this is not a common practice anyway (yet? :-))...
- we've already discussed that it's more optimal to check againt 0 than
   Against. :-)
  against -ENXIO in the callers.
   And we also aim to be the error code agnostic in the callers...
quoted
 - Rename platform_get_irq_optional() to platform_get_irq_silently()
   NAK as well. We'd better off complaining about irq < 0 in this function.
quoted
 - Keep platform_get_irq_optional() as is
   NAK, it's suboptimal in the call sites.
   s/in/on/.

[...]
quoted
Best regards
Uwe
MBR, Sergey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help