Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp336931pxv; Thu, 15 Jul 2021 05:34:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgv6KetfGBZ7XSb42aM0A4KMIML8Z/7uKukAeOeZALzbF6gcakhoP6p2SGQruFM8PsMqNp X-Received: by 2002:a50:fe97:: with SMTP id d23mr6614442edt.169.1626352456442; Thu, 15 Jul 2021 05:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626352456; cv=none; d=google.com; s=arc-20160816; b=qrjRpuaEsCBBDjg9dxLPMdJ8R+8QPeJ0BW3XDFrPzoCKGZhTDNHzyj6L+4+O3agOPd 3ei2uRxnlNeiuee/4yqghRCHEOHXLHt4+7JO3ZJDbGXGGVeLiQtcxBjiyReIeE585XvJ B4WLnqP1+afcW0RC9sT9APtPZIyh6EOdWti933/k+XGmz5emETzppo7WmK4ODuujlhhB NZIdnLxtm7ToQ3uFpjqDVgcNECS1Jhlt2j/idWRjIae+xWU0PezGE9zvjCTNdt4322Wz ytB5QWW4jUcwpTxvdcF0ushZhc7FsDRZcG2YNYu8MYeObpieT775bS7HW9U3e8eV4gwU tZAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject; bh=+aOlIiayISW74xALsur6j3b8RNLMjSh0IrocQvC5z7s=; b=Ne19wJcS/vs0lRLPeaBJvqmv8rN7XAtUTvoLGOgCv9g/M1PVeELxZIQDYrH/o34v/4 QFEkqxeEmLFnrhvqxFggbia0BEJ0ev70KyaYBLtWsCLUkfgOZxZFme7XTHW72muUDyEI J8yljCBFBHGC8Smlm1gSBcOp6fRemHMYh2igP+ddd6QaH8SmIjktKyuj4iL8K0NHv8Ip QKgU+cjNWfqz3PCAmRBT0TPjk1AlnGLlkuRL7ZMljEgLHg7ejXyaPHkNH8qA8cDU/pn8 TEIcU76ceJOTwPOEYTivQzzSlj0gehca8VPTVQ0AZiG2iOZEv7HgIMMupRuWa5qzzhKC dw0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si7576301edf.463.2021.07.15.05.33.53; Thu, 15 Jul 2021 05:34:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229979AbhGOLwY (ORCPT + 99 others); Thu, 15 Jul 2021 07:52:24 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:15020 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbhGOLwY (ORCPT ); Thu, 15 Jul 2021 07:52:24 -0400 Received: from dggeml759-chm.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GQXdG5h0jzbcPV; Thu, 15 Jul 2021 19:46:10 +0800 (CST) Received: from [10.174.178.165] (10.174.178.165) by dggeml759-chm.china.huawei.com (10.1.199.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 15 Jul 2021 19:49:28 +0800 Subject: Re: [PATCH] pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry() To: Zhen Lei , 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> From: "weiyongjun (A)" Message-ID: <55d02087-e2c7-9a0c-e20e-ff6f106703a3@huawei.com> Date: Thu, 15 Jul 2021 19:49:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20210715064206.3193-1-thunder.leizhen@huawei.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.165] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggeml759-chm.china.huawei.com (10.1.199.138) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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.