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 60121C3DA6F for ; Thu, 24 Aug 2023 16:18:11 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=NQgsiCTVluLqbl275mBq4hJ5WmP9I5vQ1+XImlQZ5es=; b=YsNk8o/QrKO8Jp UVlEphzb5o50SGMfHeH40cmv6BixDAibawvtbAjRsRgN8W7/eAJxgFeskQeyZdK9wkEh1HqLOEaTn pi21z5mMbdX7Yeq8sxXFjxz1jRo1OUZW8NDeTTlXBW+WUVRN8Eryr6JtxcG8Es/zJkqUw662/AiNb Ir9nhWMOZgv1OVqLIUaK46Oq3F17sD46oemps5LHY1x/5Esahpc1oHaH6r8tfuf+FmjUtgMci2SjZ WPfazBvcFWCekUv2tlcTZTl2kfiP/ftDM/AysfONKFrCZZVKOa3PBaQWu85+yJH9qxLPe7C788tUZ WlKjAVp2yhqhlTa6mH6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qZD1d-003RH2-2I; Thu, 24 Aug 2023 16:17:37 +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 1qZD1b-003RGb-0X for linux-arm-kernel@lists.infradead.org; Thu, 24 Aug 2023 16:17:36 +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 3FD6364A9F; Thu, 24 Aug 2023 16:17:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB957C433C7; Thu, 24 Aug 2023 16:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692893852; bh=0+M7zoq0WHaVE26wfktTsuEi2A298+WO4r1QiQDwG4s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k1ofjpBNcc4dRn90B5WKLb08p16SeFC9xTy9u29NLMlC024UbTDKTqxk5hmJWPhQU XE7tHwb9faZFTwufpIDwY4pb4den+jD6JlO4H80ORcvL4yiYdArO4V9SbvyiGvj3BM HF/JlG5ZslPNo03Jh3kE8GqmxW9fDuvXl2Kos8YqrVHHtgsyDWlh4bFTEeCCZdQKSg 1HPCKCHY8YIqze9BgVU2D5ZrGcurf0oib8QC1nGFsptSmFpaVOQdyZznLsaUbigmLT fgaNj9tBt4NvFxHoJ3ZDtv/pqy2TTGUUKYOa/TXV81LALTHxAGG3DcmPzdtY5Ld2g1 8XSZP45lBNJPw== Date: Thu, 24 Aug 2023 18:17:27 +0200 From: Andi Shyti To: Oleksij Rempel Subject: Re: [PATCH -next v3] I2C: Make return value check more accurate and explicit for devm_pinctrl_get() Message-ID: <20230824161727.czobz3p4d5bdxtrh@intel.intel> References: <20230821032914.1976317-1-ruanjinjie@huawei.com> <20230824083453.GB31399@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230824083453.GB31399@pengutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230824_091735_251318_A6F34D66 X-CRM114-Status: GOOD ( 24.93 ) 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: , Cc: Alexandre Belloni , Sascha Hauer , Fabio Estevam , linus.walleij@linaro.org, linux@armlinux.org.uk, linux-i2c@vger.kernel.org, Pengutronix Kernel Team , Claudiu Beznea , Codrin Ciubotariu , Oleksij Rempel , Shawn Guo , Jinjie Ruan , linux-arm-kernel@lists.infradead.org, NXP Linux Team 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, On Thu, Aug 24, 2023 at 10:34:53AM +0200, Oleksij Rempel wrote: > On Mon, Aug 21, 2023 at 11:29:14AM +0800, Jinjie Ruan wrote: > > If pinctrl is not available (thus devm_pinctrl_get() returns NULL) then > > recovery can't work, because we can't switch the I2C pins between the > > I2C controller and GPIO. So, it is quite correct to print > > "can't get pinctrl, bus recovery not supported" because the I2C bus > > can't be recovered without pinctrl. > > > > The PTR_ERR() is also fine - because if pinctrl is not present and > > returns NULL, we'll end up returning zero, which is exactly what we > > want. > > > > However, open code that with a more accurate message will be more explicit > > for NULL case when CONFIG_PINCTRL is not defined. > > > > Signed-off-by: Jinjie Ruan > > Acked-by: Oleksij Rempel > > Reviewed-by: Linus Walleij > > Acked-by: Nicolas Ferre > > Suggested-by: Russell King (Oracle) > > --- > > v3: > > - Split into two if() statements instead of removing the NULL checks. > > - Remove the fix tags. > > - Update the commit title and message. > > - Update to bring the author's name before. > > v2: > > - Remove NULL check instead of using IS_ERR_OR_NULL() to avoid leaving them behind. > > - Update the commit title and message. > > --- > > drivers/i2c/busses/i2c-at91-master.c | 6 +++++- > > drivers/i2c/busses/i2c-imx.c | 6 +++++- > > 2 files changed, 10 insertions(+), 2 deletions(-) > > Acked-by: Oleksij Rempel > > for the i2c-imx.c For some reason lore+lei failed to deliver this message to my inbox :/ Anyway, looks good! Reviewed-by: Andi Shyti Thank you, Jinjie for following up. Andi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel