From patchwork Sat Nov 26 14:35:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyufen X-Patchwork-Id: 628972 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 36F2BC4321E for ; Sat, 26 Nov 2022 14:15:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229489AbiKZOP3 (ORCPT ); Sat, 26 Nov 2022 09:15:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiKZOP2 (ORCPT ); Sat, 26 Nov 2022 09:15:28 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F7A61D30B for ; Sat, 26 Nov 2022 06:15:27 -0800 (PST) Received: from canpemm500010.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NKDJV3cFTzRpLZ; Sat, 26 Nov 2022 22:14:50 +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; Sat, 26 Nov 2022 22:15:24 +0800 From: Wang Yufen To: , , , CC: , , Wang Yufen Subject: [PATCH] usb: musb: fix error return code in da8xx_musb_init() Date: Sat, 26 Nov 2022 22:35:32 +0800 Message-ID: <1669473332-14165-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 -ENODEV instead of 0 as before commit 09721ba6daa1 ("usb: musb: da8xx: Call earlier clk_prepare_enable()") did. Fixes: 09721ba6daa1 ("usb: musb: da8xx: Call earlier clk_prepare_enable()") Signed-off-by: Wang Yufen --- drivers/usb/musb/da8xx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index a4e55b0..d47e5c9 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -368,8 +368,10 @@ static int da8xx_musb_init(struct musb *musb) /* Returns zero if e.g. not clocked */ rev = musb_readl(reg_base, DA8XX_USB_REVISION_REG); - if (!rev) + if (!rev) { + ret = -ENODEV; goto fail; + } musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); if (IS_ERR_OR_NULL(musb->xceiv)) {