From patchwork Tue Nov 29 07:32:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyufen X-Patchwork-Id: 629438 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 437C8C4332F for ; Tue, 29 Nov 2022 07:13:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbiK2HNG (ORCPT ); Tue, 29 Nov 2022 02:13:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiK2HND (ORCPT ); Tue, 29 Nov 2022 02:13:03 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D46742657F; Mon, 28 Nov 2022 23:13:02 -0800 (PST) Received: from canpemm500010.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NLtnf237mz15Mt5; Tue, 29 Nov 2022 15:12:22 +0800 (CST) Received: from localhost.localdomain (10.175.112.70) 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 15:13:00 +0800 From: Wang Yufen To: , , CC: , , Subject: [PATCH v4] USB: FHCI: fix error return code in of_fhci_probe() Date: Tue, 29 Nov 2022 15:32:38 +0800 Message-ID: <1669707158-43984-1-git-send-email-wangyufen@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.70] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500010.china.huawei.com (7.192.105.118) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 Reviewed-by: Vincent Mailhol --- drivers/usb/host/fhci-hcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c index 95a4446..f84f1c8 100644 --- a/drivers/usb/host/fhci-hcd.c +++ b/drivers/usb/host/fhci-hcd.c @@ -639,8 +639,8 @@ static int of_fhci_probe(struct platform_device *ofdev) NULL, i, GPIOD_OUT_LOW); if (IS_ERR(fhci->gpiods[i])) { - dev_err(dev, "incorrect GPIO%d: %ld\n", - i, PTR_ERR(fhci->gpiods[i])); + ret = PTR_ERR(fhci->gpiods[i]); + dev_err(dev, "incorrect GPIO%d: %d\n", i, ret); goto err_gpios; } if (!fhci->gpiods[i]) {