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 60746C05052 for ; Fri, 18 Aug 2023 07:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358175AbjHRH1z (ORCPT ); Fri, 18 Aug 2023 03:27:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358198AbjHRH1f (ORCPT ); Fri, 18 Aug 2023 03:27:35 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F0143C0C; Fri, 18 Aug 2023 00:27:31 -0700 (PDT) Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RRtfh1lz7zFqkp; Fri, 18 Aug 2023 15:24:28 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 18 Aug 2023 15:27:26 +0800 Message-ID: Date: Fri, 18 Aug 2023 15:27:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH -next v2] I2C: Fix return value check for devm_pinctrl_get() Content-Language: en-US To: Linus Walleij , Sascha Hauer CC: Yann Sionneau , Leo Li , Codrin Ciubotariu , Andi Shyti , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Fabio Estevam , dl-linux-imx , Wolfram Sang , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , , , "linux-i2c@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" References: <20230817022018.3527570-1-ruanjinjie@huawei.com> <6b508343-7b7f-0fd5-d83f-92dc88a9510d@sionneau.net> <20230818053254.GK5650@pengutronix.de> From: Ruan Jinjie In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.109.254] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On 2023/8/18 15:18, Linus Walleij wrote: > On Fri, Aug 18, 2023 at 7:33 AM Sascha Hauer wrote: > >> NULL is returned on purpose. When PINCTRL is disabled NULL becomes a >> valid pinctrl cookie which can be passed to the other stub functions. >> With this drivers using pinctrl can get through their probe function >> without an error when PINCTRL is disabled. >> >> The same approach is taken by the clk and regulator API. >> >> It is correct to test the return value of devm_pinctrl_get() with >> IS_ERR(), only the commit message of these patches is a bit inaccurate. > > Sascha is spot on, maybe copyedit some of the above > into the commit message and resend? OK! I'll resend it. > > Yours, > Linus Walleij