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: 13178075 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18212C6FD1F for ; Thu, 16 Mar 2023 16:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fkrM6fVeuo1PVOXw+ClfYWfEPgp6LVj8NxTO4z0uJ8k=; b=xbKaJ7dcvuNbZL pZKaHxSz05yaLmS75dEiU+1aE+NkFbUJNj7j1EscQRlM7xc9dt17DRjvkdtoNT41AidWRAh8gN0a9 Vr/Q+MBaig4bZEFTwh0wJHviEeVwPuCwJMCaTMjwXuly1nwq11rcTU8UnHfDniAGv8l1YGP0gMEFI scg8lkzhkycr9f8rHBvcJft8gL8HTRTM50djaClbraYaCVVQiplI9pvwylwY5Fvj94vr5but8RPba 8KoZwe3iST8zpIx1sWCKLRpiJ397krFOmhGiFVTHIeE3Gj9ubPFiibGp6+OMCKa+mrxZZN3C0BCmj J48a3fr+AG/aqL8ZDZdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcqrm-00H3n9-1f; Thu, 16 Mar 2023 16:54:14 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcqrh-00H3lJ-2L for linux-arm-kernel@lists.infradead.org; Thu, 16 Mar 2023 16:54:12 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230316_095410_953088_67C45BCD X-CRM114-Status: GOOD ( 15.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; }