Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1260554pxb; Fri, 21 Jan 2022 13:40:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJ1H1rUH+WInfAomphkAzGqQwdJaLx6oQ02UvZvh2YWz0KhvYFwECwuSDULOrjKzeL2X1Y X-Received: by 2002:a05:6a00:8c5:b0:4bc:4c7e:7742 with SMTP id s5-20020a056a0008c500b004bc4c7e7742mr5429088pfu.18.1642801218804; Fri, 21 Jan 2022 13:40:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642801218; cv=none; d=google.com; s=arc-20160816; b=JrKZ774QQ5iZVjsx3OYoM3NtWfod/oy+//hQ5oDw8cTMQjmEcpCREUXveZgMaIP0L3 wflBi2mTAE4c6vobq/4c46EEVu9DKjOdlzW1E2TdviKpNqZ40fcs0Sqr+4H0+m+rz/Vu 8gn+Qtu79QpRXfYAzmu0gxkVFPJ801Uaze6iCE9ElqrIN75t45p5E32yMdAZ4DHFQJZl uq0GadkV7mud2qn4XrMvhFgOdhqvoOqCii72VtjEjyv00CNq4oCETZ7DnL+818VEq9Us rN9JowzLOSs66Dg7NsaA5NSJI8uwoTuLH4Xr20XRUtL8zkZt5tw6ZaD9RxKL2YxNAHJm iUMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :references:cc:to:subject:from:dkim-filter; bh=0ybDMevbfAlvoFVKnJuuQhGluMniPSgW4GQ+sayPz7I=; b=CSeHSfYLdfIR1Krropdmrtz25eHJw1Nuh81lpnROR6ZZWKBWmpwYIIAzGxcmtccZs3 7+cnBg9HQjOEzurnJ+Kor1YwYGKNllvfbBM1Z/xKQHb9cKzoI7TXs/rSRIL/tgD+dz0S PV9OhpxKUauFRcYsWIq70nPYZzVilYGaOWRdt1PQIQrVAIc7yIrbIgXtHFstcBQCcFZy Y9hSsY2q3R2lAMuV8EdiaBY9+QIIy3Q4QSW36/vasB+GAPD/GPzSJT/pFFMXzDbX2OlV NtHFxML4BtYtzxm/aPe3YcqtibkCsk0ojg7GT306q6Q/19uOZ6UjAmBZDhDv2xIoSGWk 9IPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i4si1193455pgj.317.2022.01.21.13.40.06; Fri, 21 Jan 2022 13:40:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231378AbiATL1a (ORCPT + 99 others); Thu, 20 Jan 2022 06:27:30 -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