From patchwork Sat Aug 3 06:14:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cuigaosheng X-Patchwork-Id: 13752258 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 DB698C3DA4A for ; Sat, 3 Aug 2024 06:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version: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:In-Reply-To:References:List-Owner; bh=GmwD6LAaVDtDA5s6B/50uatvCdrWq6F5ou6K1oF8Vi4=; b=xT8kibMaRaV4S0X63oU6bkWjK5 9cvrlfWxzDIJPM70Vmw/0L0Miibofi15ZtdzQbqfiKN0MAEq6teFQPdU53XiuZzeI+A8d0ZKPo2r6 gfRcNV0SuNvKztWjXzQCO9sYUfT5zoWHPxbu7BbyB091OFQ1x42pJ/yyZEAb6F9EvRXLJsdj529G7 OKBsOQ833sKaapeHls0MaZRRB7rwgi2POqBakKf6IqfChM7XdgUKCbJOBRhGIxkE34xpws217+YlO 9otbrvGW0Hpiy9l0lX17QbRus322AVMLp/5r+3Jt/votisAC7rWNi3oacOmTXBtbGk1edROvB/bIm R8YE4q9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sa838-0000000AsIk-3SR9; Sat, 03 Aug 2024 06:15:31 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sa82b-0000000AsDq-3JvE for linux-arm-kernel@lists.infradead.org; Sat, 03 Aug 2024 06:15:01 +0000 Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WbXTx3mkxzxWBj; Sat, 3 Aug 2024 14:14:29 +0800 (CST) Received: from kwepemd200011.china.huawei.com (unknown [7.221.188.251]) by mail.maildlp.com (Postfix) with ESMTPS id C9ABD18007C; Sat, 3 Aug 2024 14:14:44 +0800 (CST) Received: from cgs.huawei.com (10.244.148.83) by kwepemd200011.china.huawei.com (7.221.188.251) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Sat, 3 Aug 2024 14:14:44 +0800 From: Gaosheng Cui To: , , , , CC: , , Subject: [PATCH -next] hwspinlock: stm32: Add missing clk_disable_unprepare in stm32_hwspinlock_probe Date: Sat, 3 Aug 2024 14:14:43 +0800 Message-ID: <20240803061443.287117-1-cuigaosheng1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.244.148.83] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemd200011.china.huawei.com (7.221.188.251) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240802_231458_037300_88C1CFEC X-CRM114-Status: GOOD ( 11.39 ) 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 Add the missing clk_disable_unprepare() before return in stm32_hwspinlock_probe(). Signed-off-by: Gaosheng Cui --- drivers/hwspinlock/stm32_hwspinlock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c index bb5c7e5f7a80..a4e3b9a9e29d 100644 --- a/drivers/hwspinlock/stm32_hwspinlock.c +++ b/drivers/hwspinlock/stm32_hwspinlock.c @@ -103,6 +103,7 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev) ret = devm_add_action_or_reset(dev, stm32_hwspinlock_disable_clk, pdev); if (ret) { dev_err(dev, "Failed to register action\n"); + clk_disable_unprepare(hw->clk); return ret; } @@ -112,8 +113,10 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev) ret = devm_hwspin_lock_register(dev, &hw->bank, &stm32_hwspinlock_ops, 0, STM32_MUTEX_NUM_LOCKS); - if (ret) + if (ret) { dev_err(dev, "Failed to register hwspinlock\n"); + clk_disable_unprepare(hw->clk); + } return ret; }