From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BD25C433EF for ; Thu, 20 Jan 2022 11:27:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231366AbiATL1d (ORCPT ); Thu, 20 Jan 2022 06:27:33 -0500 Received: from mxout04.lancloud.ru ([45.84.86.114]:54944 "EHLO mxout04.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230371AbiATL1T (ORCPT ); Thu, 20 Jan 2022 06:27:19 -0500 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru C003420DA1E6 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov Subject: Re: [PATCH 1/2] platform: make platform_get_irq_optional() optional To: Geert Uytterhoeven , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= CC: Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , KVM list , "Rafael J. Wysocki" , , "Linus Walleij" , Amit Kucheria , "ALSA Development Mailing List" , Andy Shevchenko , Jaroslav Kysela , Guenter Roeck , Thierry Reding , MTD Maling List , Linux I2C , Miquel Raynal , , Jiri Slaby , , "Khuong Dinh" , Florian Fainelli , Matthias Schiffer , Joakim Zhang , Kamal Dasu , Greg Kroah-Hartman , Lee Jones , "Bartosz Golaszewski" , Daniel Lezcano , "Tony Luck" , Kishon Vijay Abraham I , bcm-kernel-feedback-list , "open list:SERIAL DRIVERS" , Jakub Kicinski , Zhang Rui , Linux PWM List , Robert Richter , "Saravanan Sekar" , Corey Minyard , Linux PM list , Linux Kernel Mailing List , Mauro Carvalho Chehab , John Garry , Peter Korsgaard , William Breathitt Gray , Mark Gross , "open list:GPIO SUBSYSTEM" , Alex Williamson , Mark Brown , Borislav Petkov , "Sebastian Reichel" , Eric Auger , "Matthias Brugger" , Takashi Iwai , , Benson Leung , Linux ARM , , Mun Yew Tham , "Hans de Goede" , netdev , "Yoshihiro Shimoda" , Cornelia Huck , Linux MMC List , "Liam Girdwood" , linux-spi , Linux-Renesas , Vinod Koul , James Morse , Zha Qipeng , Pengutronix Kernel Team , Richard Weinberger , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , , "Brian Norris" , "David S. Miller" References: <20220112213121.5ruae5mxwj6t3qiy@pengutronix.de> <29f0c65d-77f2-e5b2-f6cc-422add8a707d@omp.ru> <20220114092557.jrkfx7ihg26ekzci@pengutronix.de> <61b80939-357d-14f5-df99-b8d102a4e1a1@omp.ru> <20220114202226.ugzklxv4wzr6egwj@pengutronix.de> <20220117092444.opoedfcf5k5u6otq@pengutronix.de> <20220117114923.d5vajgitxneec7j7@pengutronix.de> Organization: Open Mobile Platform Message-ID: Date: Thu, 20 Jan 2022 14:27:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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