Re: [PATCH 1/2] platform: make platform_get_irq_optional() optional
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH 1/2] platform: make platform_get_irq_optional() optional
- From: Sergey Shtylyov <s.shtylyov@xxxxxx>
- Date: Thu, 20 Jan 2022 14:27:08 +0300
- Cc: Andrew Lunn <andrew@xxxxxxx>, Ulf Hansson <ulf.hansson@xxxxxxxxxx>, Vignesh Raghavendra <vigneshr@xxxxxx>, KVM list <kvm@xxxxxxxxxxxxxxx>, "Rafael J. Wysocki" <rafael@xxxxxxxxxx>, <linux-iio@xxxxxxxxxxxxxxx>, "Linus Walleij" <linus.walleij@xxxxxxxxxx>, Amit Kucheria <amitk@xxxxxxxxxx>, "ALSA Development Mailing List" <alsa-devel@xxxxxxxxxxxxxxxx>, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>, Jaroslav Kysela <perex@xxxxxxxx>, Guenter Roeck <groeck@xxxxxxxxxxxx>, Thierry Reding <thierry.reding@xxxxxxxxx>, MTD Maling List <linux-mtd@xxxxxxxxxxxxxxxxxxx>, Linux I2C <linux-i2c@xxxxxxxxxxxxxxx>, Miquel Raynal <miquel.raynal@xxxxxxxxxxx>, <linux-phy@xxxxxxxxxxxxxxxxxxx>, Jiri Slaby <jirislaby@xxxxxxxxxx>, <openipmi-developer@xxxxxxxxxxxxxxxxxxxxx>, "Khuong Dinh" <khuong@xxxxxxxxxxxxxxxxxxxxxx>, Florian Fainelli <f.fainelli@xxxxxxxxx>, Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>, Joakim Zhang <qiangqing.zhang@xxxxxxx>, Kamal Dasu <kdasu.kdev@xxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Lee Jones <lee.jones@xxxxxxxxxx>, "Bartosz Golaszewski" <brgl@xxxxxxxx>, Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>, "Tony Luck" <tony.luck@xxxxxxxxx>, Kishon Vijay Abraham I <kishon@xxxxxx>, bcm-kernel-feedback-list <bcm-kernel-feedback-list@xxxxxxxxxxxx>, "open list:SERIAL DRIVERS" <linux-serial@xxxxxxxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Zhang Rui <rui.zhang@xxxxxxxxx>, Linux PWM List <linux-pwm@xxxxxxxxxxxxxxx>, Robert Richter <rric@xxxxxxxxxx>, "Saravanan Sekar" <sravanhome@xxxxxxxxx>, Corey Minyard <minyard@xxxxxxx>, Linux PM list <linux-pm@xxxxxxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>, John Garry <john.garry@xxxxxxxxxx>, Peter Korsgaard <peter@xxxxxxxxxxxxx>, William Breathitt Gray <vilhelm.gray@xxxxxxxxx>, Mark Gross <markgross@xxxxxxxxxx>, "open list:GPIO SUBSYSTEM" <linux-gpio@xxxxxxxxxxxxxxx>, Alex Williamson <alex.williamson@xxxxxxxxxx>, Mark Brown <broonie@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, "Sebastian Reichel" <sre@xxxxxxxxxx>, Eric Auger <eric.auger@xxxxxxxxxx>, "Matthias Brugger" <matthias.bgg@xxxxxxxxx>, Takashi Iwai <tiwai@xxxxxxxx>, <platform-driver-x86@xxxxxxxxxxxxxxx>, Benson Leung <bleung@xxxxxxxxxxxx>, Linux ARM <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, <linux-edac@xxxxxxxxxxxxxxx>, Mun Yew Tham <mun.yew.tham@xxxxxxxxx>, "Hans de Goede" <hdegoede@xxxxxxxxxx>, netdev <netdev@xxxxxxxxxxxxxxx>, "Yoshihiro Shimoda" <yoshihiro.shimoda.uh@xxxxxxxxxxx>, Cornelia Huck <cohuck@xxxxxxxxxx>, Linux MMC List <linux-mmc@xxxxxxxxxxxxxxx>, "Liam Girdwood" <lgirdwood@xxxxxxxxx>, linux-spi <linux-spi@xxxxxxxxxxxxxxx>, Linux-Renesas <linux-renesas-soc@xxxxxxxxxxxxxxx>, Vinod Koul <vkoul@xxxxxxxxxx>, James Morse <james.morse@xxxxxxx>, Zha Qipeng <qipeng.zha@xxxxxxxxx>, Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx>, Richard Weinberger <richard@xxxxxx>, Niklas Söderlund <niklas.soderlund@xxxxxxxxxxxx>, <linux-mediatek@xxxxxxxxxxxxxxxxxxx>, "Brian Norris" <computersforpeace@xxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>
- In-reply-to: <CAMuHMdWCKERO20R2iVHq8P=BaoauoBAtiampWzfMRYihi3Sb0g@mail.gmail.com>
- Organization: Open Mobile Platform
- References: <20220112213121.5ruae5mxwj6t3qiy@pengutronix.de> <Yd9L9SZ+g13iyKab@sirena.org.uk> <29f0c65d-77f2-e5b2-f6cc-422add8a707d@omp.ru> <20220114092557.jrkfx7ihg26ekzci@pengutronix.de> <61b80939-357d-14f5-df99-b8d102a4e1a1@omp.ru> <20220114202226.ugzklxv4wzr6egwj@pengutronix.de> <c9026f17-2b3f-ee94-0ea3-5630f981fbc1@omp.ru> <CAMuHMdXVbRudGs69f9ZzaP1PXhteDNZiXA658eMFAwP4nr9r3w@mail.gmail.com> <20220117092444.opoedfcf5k5u6otq@pengutronix.de> <CAMuHMdUgZUeraHadRAi2Z=DV+NuNBrKPkmAKsvFvir2MuquVoA@mail.gmail.com> <20220117114923.d5vajgitxneec7j7@pengutronix.de> <CAMuHMdWCKERO20R2iVHq8P=BaoauoBAtiampWzfMRYihi3Sb0g@mail.gmail.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1
On 1/17/22 4:08 PM, Geert Uytterhoeven wrote:
[...]
>>> But as we were all in a hurry to kill the non-applicable error
>>> message, we went for the quick and dirty fix.
>>>
>>>> Also I fail to see how a caller of (today's) platform_get_irq_optional()
>>>> is simpler than a caller of platform_get_irq() given that there is no
>>>> semantic difference between the two. Please show me a single
>>>> conversion from platform_get_irq to platform_get_irq_optional that
>>>> yielded a simplification.
>>>
>>> That's exactly why we want to change the latter to return 0 ;-)
>>
>> OK. So you agree to my statement "The reason for
>> platform_get_irq_optional()'s existence is just that platform_get_irq()
>> emits an error message [...]". Actually you don't want to oppose but
>> say: It's unfortunate that the silent variant of platform_get_irq() took
>> the obvious name of a function that could have an improved return code
>> semantic.
>>
>> So my suggestion to rename todays platform_get_irq_optional() to
>> platform_get_irq_silently() and then introducing
>> platform_get_irq_optional() with your suggested semantic seems
>> intriguing and straigt forward to me.
>
> I don't really see the point of needing platform_get_irq_silently(),
> unless as an intermediary step, where it's going to be removed again
> once the conversion has completed.
> Still, the rename would touch all users at once anyway.
>
>> Another thought: platform_get_irq emits an error message for all
>> problems. Wouldn't it be consistent to let platform_get_irq_optional()
>> emit an error message for all problems but "not found"?
>> Alternatively remove the error printk from platform_get_irq().
>
> Yes, all problems but not found are real errors.
ACK for using dev_err_probe() in platfrom_get_irq_optional()
for the real errors...
I've also noted that only platfrom_get_irq_optional() got converted
from dev_err() to dev_err_probe() but not platfrom_get_irq_byname_optional()...
[...]
> Gr{oetje,eeting}s,
>
> Geert
MBR, Sergey
[Index of Archives]
[Linux Kernel]
[Linux ARM (vger)]
[Linux ARM MSM]
[Linux Omap]
[Linux Arm]
[Linux Tegra]
[Fedora ARM]
[Linux for Samsung SOC]
[eCos]
[Linux Fastboot]
[Gcc Help]
[Git]
[DCCP]
[IETF Announce]
[Security]
[Linux MIPS]
[Yosemite Campsites]
|