From patchwork Tue Nov 29 06:43:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyufen X-Patchwork-Id: 629857 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 61BFFC4332F for ; Tue, 29 Nov 2022 06:23:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235667AbiK2GXv (ORCPT ); Tue, 29 Nov 2022 01:23:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235214AbiK2GXu (ORCPT ); Tue, 29 Nov 2022 01:23:50 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 946214875D; Mon, 28 Nov 2022 22:23:49 -0800 (PST) Received: from canpemm500010.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NLshr4ksMzmW4d; Tue, 29 Nov 2022 14:23:08 +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 14:23:47 +0800 From: Wang Yufen To: , , CC: , , Subject: [PATCH v3] USB: FHCI: fix error return code in of_fhci_probe() Date: Tue, 29 Nov 2022 14:43:52 +0800 Message-ID: <1669704232-40228-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: dggems706-chm.china.huawei.com (10.3.19.183) 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 --- drivers/usb/host/fhci-hcd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c index 95a4446..c8a1b98 100644 --- a/drivers/usb/host/fhci-hcd.c +++ b/drivers/usb/host/fhci-hcd.c @@ -639,8 +639,9 @@ 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]) {