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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48CECC433F5 for ; Mon, 14 Feb 2022 11:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JFYIwZdP0cttvFeshX+hrWREd8nlKpsEuP38Ki+64Uw=; b=g5q4pOzGNeSlfC cwR6UlfYTHdWVr2Mn62pLu52j3YuwlTtHjmvYwJt4K9nCpYYRwxkLw+45Ny43yetJeX08J/S8Ey8p iZFHPGLGksyWwBV4a1ZObtHP0HXUmb4LHOpY4NRJKjwo2UNmn1zl8FDPhyi51vPecvOERCs9M/PSD VPC3LM7gw45ALjmYjCWQMJflclLo/YMLVYCB9gx4Y/7o6yE1ZindE6GRSQzugKbOAovKRH6DsV2Pj fTIE8KJHJFidQhHahcNm08JhCFVT2FW3FyBJ1vwV5ShWw9M81CHB3ixBjDmo+M/AHcKILKWInIJWN 7zNPn81uK05Q1Yl1BM8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJZfb-00Es9F-BL; Mon, 14 Feb 2022 11:37:27 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJYPJ-00ESMH-Pl; Mon, 14 Feb 2022 10:16:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644833793; x=1676369793; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=iMfir8Hys8PoRkg7XbbXRj39pNMes8hLErnltaIltH8=; b=H0pRtYXVokRBX+RGOdsauOP2aIBK1vtMoRGVk+VDUjA0gjIToKp08alR Tm18cVC3x44oAcrbuiqx/MzOE8OK4CduA2tcM/A1XkQRsBI7PovauGPJd 0kz34pErXmws8kirxEiFlrcm3UmngipUs6aMo6zPHQmDtF9jNxNgty5Eu x+fAcade60DLDG7Rwc6dU+y5s++sSBiaXXsF0yEQzBwK49KC3bxrLe4wT TpB1A+VMBkcYrK8YoNp/BJt8twTNALUNIl+xHo6DUgdP8dwR9lZ7s8WuF dPG9EmE0KsElsnrAyZkL2fICumUH0C3VBRwIxaCvdCGRHPC478tlmkk2s g==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="274630826" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="274630826" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:32 -0800 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="603187011" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:17 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nJYLy-004PC8-6n; Mon, 14 Feb 2022 12:13:06 +0200 Date: Mon, 14 Feb 2022 12:13:01 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Sergey Shtylyov , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , Jiri Slaby , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , alsa-devel@alsa-project.org, Liam Girdwood , linux-phy@lists.infradead.org, Thierry Reding , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, Miquel Raynal , Guenter Roeck , linux-spi@vger.kernel.org, Lee Jones , openipmi-developer@lists.sourceforge.net, Peter Korsgaard , Florian Fainelli , Matthias Schiffer , kvm@vger.kernel.org, Kamal Dasu , Richard Weinberger , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , bcm-kernel-feedback-list@broadcom.com, linux-serial@vger.kernel.org, Jakub Kicinski , Zhang Rui , Jaroslav Kysela , platform-driver-x86@vger.kernel.org, linux-pwm@vger.kernel.org, Zha Qipeng , Corey Minyard , linux-pm@vger.kernel.org, John Garry , William Breathitt Gray , Mark Gross , Hans de Goede , Alex Williamson , Mark Brown , linux-mediatek@lists.infradead.org, Matthias Brugger , Takashi Iwai , Benson Leung , linux-arm-kernel@lists.infradead.org, Mun Yew Tham , Eric Auger , netdev@vger.kernel.org, Yoshihiro Shimoda , Cornelia Huck , linux-mmc@vger.kernel.org, Joakim Zhang , Oleksij Rempel , linux-renesas-soc@vger.kernel.org, Vinod Koul , Pengutronix Kernel Team , Niklas =?iso-8859-1?Q?S=F6derlund?= , Brian Norris , "David S. Miller" Subject: Re: [PATCH v2 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220212201631.12648-1-s.shtylyov@omp.ru> <20220212201631.12648-2-s.shtylyov@omp.ru> <20220214071351.pcvstrzkwqyrg536@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220214071351.pcvstrzkwqyrg536@pengutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220214_021633_909796_0B61305A X-CRM114-Status: GOOD ( 25.15 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, Feb 14, 2022 at 08:13:51AM +0100, Uwe Kleine-K=F6nig wrote: > On Sat, Feb 12, 2022 at 11:16:30PM +0300, Sergey Shtylyov wrote: > > This patch is based on the former Andy Shevchenko's patch: > > = > > https://lore.kernel.org/lkml/20210331144526.19439-1-andriy.shevchenko@l= inux.intel.com/ > > = > > Currently platform_get_irq_optional() returns an error code even if IRQ > > resource simply has not been found. It prevents the callers from being > > error code agnostic in their error handling: > > = > > ret =3D platform_get_irq_optional(...); > > if (ret < 0 && ret !=3D -ENXIO) > > return ret; // respect deferred probe > > if (ret > 0) > > ...we get an IRQ... > > = > > All other *_optional() APIs seem to return 0 or NULL in case an optional > > resource is not available. Let's follow this good example, so that the > > callers would look like: > > = > > ret =3D platform_get_irq_optional(...); > > if (ret < 0) > > return ret; > > if (ret > 0) > > ...we get an IRQ... > > = > > Reported-by: Matthias Schiffer > > Signed-off-by: Sergey Shtylyov > = > While this patch is better than v1, I still don't like it for the > reasons discussed for v1. (i.e. 0 isn't usable as a dummy value which I > consider the real advantage for the other _get_optional() functions.) I think you haven't reacted anyhow to my point that you mixing apples and bananas together when comparing this 0 to the others _optional APIs. > Apart from that, I think the subject is badly chosen. With "Make > somefunc() optional" I would expect that you introduce a Kconfig symbol > that results in the function not being available when disabled. -- = With Best Regards, Andy Shevchenko _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek