From patchwork Thu Mar 16 16:53:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amelie Delaunay X-Patchwork-Id: 70906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp594875wrt; Thu, 16 Mar 2023 10:03:26 -0700 (PDT) X-Google-Smtp-Source: AK7set9yk1TOR6OPRY+8XekAylxpa+Dg6jRbhby6uDlpbF0RlKpEbGPIBRWA/LvKpTVfdSR21Av0 X-Received: by 2002:a05:6870:96a4:b0:17a:b822:cce7 with SMTP id o36-20020a05687096a400b0017ab822cce7mr34862oaq.20.1678986205389; Thu, 16 Mar 2023 10:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678986205; cv=none; d=google.com; s=arc-20160816; b=W1Gtw6GE1ZtdhTLRmHF8VJfwLBJ2T62DLkChccde2gZQaL1AXuRgK9eJnC0Skr6MKL gudsJHheLSMIApPMr+GrR+1Ojky/ZPpSDthSczKyZVQTP8nZwdEBP50HgzzYV0zLF2PL yw6/cdQnUkRgOU3LDBEIeCOucuzYtf5RujJRr02YrIP9s+0NnRGjcrKLkHHtzP9mnsFS X15b8d3Cadzr4PAZ0/XYQAmYc+w+tKtsGjx/EUffGs3nFd27go4LCK1+UnjyJqEPZs9f XPNK05Rvffd0k1wg+Uwc3GFIx8Oxf+uSh05iNHtbHuh0giVreTPofVtideyOi12x+KYf WsNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xBkM+wcHkn0+wAwRzFfs1U5GhFDjurk++GN6bVOC3Og=; b=FOe7kP6Lm37bPzmHoHVHpGTWdL9ZMJyOW0sftsitzqlSkw8Je+aLL5GJeCE2tPtZeY Uv/HlBGlVwLfE7yGiARLjwZZ35lPDpzisZNhEtUGXrCzvOtIf6IK3OkE+QH3RFMYKvVv K7iFnRSofP6sGXXZkerYjd4bCsnsS/lFPqPkHU0DwqiofeTV9u2ZeaH+DVlsKiMHovtm EjmBqMaf0A2/ul7QerZTP7FnnGU7ddE6YZNXZFmpEjDho3Xk6rXVcbL+X4gl2JO2ht/x S43wDmQFo6AffkhOKHpNyhANCtr1eI3ds5G1ek4X1NUvqFQvbeoGnCWseKrYiExfOte4 Oe5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=XvDoo3cS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y41-20020a056870b4a900b0017afdfade25si30836oap.287.2023.03.16.10.03.09; Thu, 16 Mar 2023 10:03:25 -0700 (PDT) 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; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=XvDoo3cS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231319AbjCPQyU (ORCPT + 99 others); Thu, 16 Mar 2023 12:54:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbjCPQyQ (ORCPT ); Thu, 16 Mar 2023 12:54:16 -0400 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE344B0B9E for ; Thu, 16 Mar 2023 09:54:13 -0700 (PDT) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32GCMrts018637; Thu, 16 Mar 2023 17:53:57 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=xBkM+wcHkn0+wAwRzFfs1U5GhFDjurk++GN6bVOC3Og=; b=XvDoo3cSem2rJP2ZZdblTx5Zmu6cku9C4Zv7kzdEVCTQqCldnRmgz3L06aeqwUXj6jIT SyMP55y0aWaa8I9zXNC6dpl2SEPUm7SdYxgk5hKQ7eA9lXs30rJfWyxIFfAYjS+BCWzT quB57Qy5tB/4f5tMo5A0uDS8mdXIDn+BeR2MPY7jPqUoPUG4izK2H239AaZSzyjKS6oG W904l2HNCjpLPoW8H/mmisUn9MGdUSEMlggX/1RcMhE6DR9PzIP88JW/SDeB1tC4Ai8O J5HBk3qAEe8rJOX12EcvmLyU5mgPt0b5pFGxCCnHXK1A9dOVsMk3fTuLkmncXgW3G+AN SA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3pbpwp604d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Mar 2023 17:53:56 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 31A90100034; Thu, 16 Mar 2023 17:53:56 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 2C3FA21ED52; Thu, 16 Mar 2023 17:53:56 +0100 (CET) Received: from localhost (10.201.20.208) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 16 Mar 2023 17:53:55 +0100 From: Amelie Delaunay To: Lee Jones , Maxime Coquelin , Alexandre Torgue CC: , , , Amelie Delaunay Subject: [PATCH 1/2] mfd: stmfx: Fix error path in stmfx_chip_init Date: Thu, 16 Mar 2023 17:53:46 +0100 Message-ID: <20230316165347.2669038-2-amelie.delaunay@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230316165347.2669038-1-amelie.delaunay@foss.st.com> References: <20230316165347.2669038-1-amelie.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.208] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-16_10,2023-03-16_01,2023-02-09_01 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760544639548070302?= X-GMAIL-MSGID: =?utf-8?q?1760544639548070302?= In error path, disable vdd regulator if it exists, but don't overload ret. Because if regulator_disable() is successful, stmfx_chip_init will exit successfully while chip init failed. Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Amelie Delaunay --- drivers/mfd/stmfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c index e281971ba54e..bfe89df27611 100644 --- a/drivers/mfd/stmfx.c +++ b/drivers/mfd/stmfx.c @@ -387,7 +387,7 @@ static int stmfx_chip_init(struct i2c_client *client) err: if (stmfx->vdd) - return regulator_disable(stmfx->vdd); + regulator_disable(stmfx->vdd); return ret; }