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 X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9C75C636C9 for ; Fri, 16 Jul 2021 01:04:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AAE52613E6 for ; Fri, 16 Jul 2021 01:04:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231176AbhGPBHO (ORCPT ); Thu, 15 Jul 2021 21:07:14 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:11429 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbhGPBHN (ORCPT ); Thu, 15 Jul 2021 21:07:13 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GQtGH3Hmnzcdjr; Fri, 16 Jul 2021 09:00:55 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 16 Jul 2021 09:04:04 +0800 Received: from [10.174.179.0] (10.174.179.0) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 16 Jul 2021 09:04:03 +0800 Subject: Re: [PATCH] pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry() To: "weiyongjun (A)" , Tony Lindgren , Haojian Zhuang , Linus Walleij , Manjunathappa Prakash , linux-arm-kernel , linux-omap , linux-gpio , linux-kernel References: <20210715064206.3193-1-thunder.leizhen@huawei.com> <55d02087-e2c7-9a0c-e20e-ff6f106703a3@huawei.com> From: "Leizhen (ThunderTown)" Message-ID: Date: Fri, 16 Jul 2021 09:04:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <55d02087-e2c7-9a0c-e20e-ff6f106703a3@huawei.com> Content-Type: text/plain; charset="UTF-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.0] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/7/15 19:49, weiyongjun (A) wrote: >> Fix to return -ENOTSUPP instead of 0 when PCS_HAS_PINCONF is true, which >> is the same as that returned in pcs_parse_pinconf(). >> >> In addition, I found the value of pcs->flags is not overwritten in >> pcs_parse_bits_in_pinctrl_entry() and its subfunctions, so moving this >> check to the beginning of the function eliminates unnecessary rollback >> operations. >> >> Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure multiple pins of different modules") >> Reported-by: Hulk Robot >> Signed-off-by: Zhen Lei >> --- >>   drivers/pinctrl/pinctrl-single.c | 21 ++++++++------------- >>   1 file changed, 8 insertions(+), 13 deletions(-) >> >> >>       npins_in_row = pcs->width / pcs->bits_per_pin; >>         vals = devm_kzalloc(pcs->dev, >> @@ -1212,29 +1217,19 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs, >>           goto free_pins; >>       } >>   -    gsel = pinctrl_generic_add_group(pcs->pctl, np->name, pins, found, pcs); >> -    if (gsel < 0) { >> -        res = gsel; >> +    res = pinctrl_generic_add_group(pcs->pctl, np->name, pins, found, pcs); >> +    if (res < 0) >>           goto free_function; >> -    } > > > This change cause 'gsel' not set. > > Do not mix this cleanup with bugfix. gsel已经不需要了,已经被我删掉了 > > > > . >