Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp355083rwb; Mon, 28 Nov 2022 22:28:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf4zaLpwbYmmSkhYo6vdWWm/VpUMOsTQgxlL+K12n+zcAvzgmn4RmJzpz+Xxf8g7nMbwO0aq X-Received: by 2002:a17:906:1585:b0:7ad:84c7:502d with SMTP id k5-20020a170906158500b007ad84c7502dmr32758723ejd.177.1669703310038; Mon, 28 Nov 2022 22:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669703310; cv=none; d=google.com; s=arc-20160816; b=qeyjHct3BS/7/sy33wWsf3co9xuN9l9WqoimsSgnXfVp+/cnRh6XRldM5UZN870A84 azPeWgNi5lsx9PWeasD7S/nxzZek81SKo7LbsenSfGQqTKzRXY3xm44Moi6lnxqfpPjr H+c4XtiCGwLx95TGPAwO63yypYgngIUUCgeRx0gzw8hxeMHZNY4dhPcxwk0ntpfu1V+8 8cg1pj+InLosjx5mdR7yeIHcTnVKoPY2U9M6dRQP9kV9NzcQEzuh0d4pqb3tqS1W5T6U /z+dfRni81T1h5x8Y9mRXT7tgjQ1dScnGevxLOUMKbrmxdcYI480WCMOAelmjHWn103k badQ== 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:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=Prd4b6lH46B3+vdLAkL/TnpS7k/biC4EnjO+FvfYAaM=; b=u67i31UmsWCuRRNSTc0xBU631zTfobrCfWF4nHrnfp3eo0DXYbl09/VFDxVcjE9NUB viw2uK3PmpHn5nu8NLSEZ9D/gs8RQFahm/a4ZHHDygQOBNtlI1VaLwCPjk7Q8Fj7/YnG WYcQszLuxz3rZh7qFMgCH+H29IoMu17Nt8PiHFOSngLAkqdXBJHpjJ0wZdRgx4tIwH8I GYW0hgd6gN7ye/ekMW62G+2zH5MjSckcgbqqoTkJmo1aRtIt6TrD0qm2CM7DXlK0Yv+v UUR6QNWxW7dPfIjZ/+xHs0S5+HSYXOn6zzxqyAX9R6ASjfdarjFj2YVMMRjVBbd9s3uk W5Aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t9-20020a50ab49000000b00461d60a86casi13314086edc.135.2022.11.28.22.28.10; Mon, 28 Nov 2022 22:28:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235435AbiK2GSA (ORCPT + 82 others); Tue, 29 Nov 2022 01:18:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234251AbiK2GR6 (ORCPT ); Tue, 29 Nov 2022 01:17:58 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 337666575; Mon, 28 Nov 2022 22:17:57 -0800 (PST) Received: from canpemm500010.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NLsZ13fKvzHw7M; Tue, 29 Nov 2022 14:17:13 +0800 (CST) Received: from [10.174.179.191] (10.174.179.191) by canpemm500010.china.huawei.com (7.192.105.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 29 Nov 2022 14:17:54 +0800 Message-ID: Date: Tue, 29 Nov 2022 14:17:54 +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] USB: FHCI: fix error return code in of_fhci_probe() To: Vincent MAILHOL CC: , , , References: <1669692810-26744-1-git-send-email-wangyufen@huawei.com> From: wangyufen In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.191] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500010.china.huawei.com (7.192.105.118) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/11/29 12:11, Vincent MAILHOL 写道: > On Tue. 29 nov. 2022 à 12:33, Wang Yufen wrote: >> Fix to return a negative error code of PTR_ERR(fhci->gpiods[i]) >> instead of 0. >> >> Fixes: a4efdb8a423b ("USB: FHCI: Switch to GPIO descriptors") >> Signed-off-by: Wang Yufen >> --- >> drivers/usb/host/fhci-hcd.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c >> index 95a4446..afef72a 100644 >> --- a/drivers/usb/host/fhci-hcd.c >> +++ b/drivers/usb/host/fhci-hcd.c >> @@ -639,6 +639,7 @@ static int of_fhci_probe(struct platform_device *ofdev) >> NULL, i, GPIOD_OUT_LOW); >> >> if (IS_ERR(fhci->gpiods[i])) { >> + ret = PTR_ERR(fhci->gpiods[i]) >> dev_err(dev, "incorrect GPIO%d: %ld\n", >> i, PTR_ERR(fhci->gpiods[i])); > > Can you add some extra clean-up and reuse ret in the dev_err()? > > dev_err(dev, "incorrect GPIO%d: %ld\n", i, ret); I prefer to reuse ret, just like other fhci->*** checks. This also keeps the code style consistent with the context. Will change in v2. Thanks. > > Alternatively you can also consider %pe to print the mnemotechnic > instead of the value: > > dev_err(dev, "incorrect GPIO%d: %pe\n", > i, fhci->gpiods[i]); > > > Yours sincerely, > Vincent Mailhol >