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 F1326EB64DD for ; Tue, 1 Aug 2023 23:36:33 +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=CARZThgs27CqbKqmp7xjRo0sb6DNuylJxSNjU+tD5+U=; b=QSchBCzW9i+2Jy 3kcUU2XIzb3SZ1R705DQM5VU9/bFC+CUxwXk4AAnkM+nNzYriDydXKXp4uLa5SbCPalu8XYTjbjoc lRTikPzGQ1aoWrxhWeO8RdxIDLN+BWoUAeQ2iQndkIiXhpuJL+xRfbn+o3TCbyxrSyN8gDRwLCBtB f8uBEd6ivk1e6iRxuGtTKgX6G2upDbEooMgwTBLuD/ChXf0Q7WrCRd4R6DVshs61Q2cgDI69rNUq8 UF7nPCnG9zwf/d4LEUqlsvYbMwFNKbFbZG/BG1L9jQ6JQDQ3SL4VWpEPc3iu3mqe4FSxw3Q+EU4VM DbcvakxAa7Div/bTVQ8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQyuQ-003XGK-2K; Tue, 01 Aug 2023 23:36:10 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQyuO-003XEZ-0G for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2023 23:36:09 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9CBFF61777; Tue, 1 Aug 2023 23:36:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47BEDC433C9; Tue, 1 Aug 2023 23:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690932966; bh=6uy6+AkDtuDOqT81p4pPLlv+19pwovDNi5W+vTBt4rc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YFcX1joZfLL2I0CQNAbI2fqLSJD/qkdQTlT3L6obsgAZ5ocO6s4LZ4dyhyKl18g/G k3Fc0fTxZGStHfURbtPnGQXY+m4cq4lJdMvny95yLD6wM4njzYF61dNRxbPS1Ihfc8 BRJt54GkPYVh87z0cWzhNAN4w7sVf2J3pz/3MC8z7euiSqPxR+96V3Qt8m2R06t7Ag GYON1fJ1wN40YxBfiaCUnBq9w89rBSuJ+50Uif//ogPq3DR09Pkwqi861v55NGwpEB us5ehLbqKuJuhJVVpvdE1w7TcSxeZo1olo2ZK2XxkMP8HV6nIKnjbR9mitM0Fzfvdr d+LzEkhVHpf2Q== Date: Wed, 2 Aug 2023 01:36:03 +0200 From: Andi Shyti To: Ruan Jinjie Cc: pierre-yves.mordret@foss.st.com, alain.volmat@foss.st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org Subject: Re: [PATCH -next] i2c: stm32: fix the return value handle for platform_get_irq() Message-ID: <20230801233603.iztyd2wqhcogr72r@intel.intel> References: <20230731112755.1943630-1-ruanjinjie@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230731112755.1943630-1-ruanjinjie@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_163608_160471_82B48B7A X-CRM114-Status: GOOD ( 18.75 ) X-BeenThere: linux-arm-kernel@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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ruan, On Mon, Jul 31, 2023 at 07:27:55PM +0800, Ruan Jinjie wrote: > There is no possible for platform_get_irq() to return 0, > and the return value of platform_get_irq() is more sensible > to show the error reason. > > Signed-off-by: Ruan Jinjie > --- > drivers/i2c/busses/i2c-stm32f7.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c > index e897d9101434..579b30581725 100644 > --- a/drivers/i2c/busses/i2c-stm32f7.c > +++ b/drivers/i2c/busses/i2c-stm32f7.c > @@ -2121,12 +2121,12 @@ static int stm32f7_i2c_probe(struct platform_device *pdev) > phy_addr = (dma_addr_t)res->start; > > irq_event = platform_get_irq(pdev, 0); > - if (irq_event <= 0) > - return irq_event ? : -ENOENT; > + if (irq_event < 0) > + return irq_event; > > irq_error = platform_get_irq(pdev, 1); > - if (irq_error <= 0) > - return irq_error ? : -ENOENT; > + if (irq_error < 0) > + return irq_error; Correct, from patch ce753ad1549cbe ("platform: finally disallow IRQ0 in platform_get_irq() and its ilk") this check is already done inside platform_get_irq(); Reviewed-by: Andi Shyti Andi > > i2c_dev->wakeup_src = of_property_read_bool(pdev->dev.of_node, > "wakeup-source"); > -- > 2.34.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel