Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp11724924rwb; Fri, 25 Nov 2022 21:10:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf652m920TEq0pXG8EtAC/FL0u/k5z6j88CEQpL6ln+/IDREgLkrPwYlkenjFgCXhrHd5gYV X-Received: by 2002:aa7:d6d9:0:b0:46a:f635:6bb2 with SMTP id x25-20020aa7d6d9000000b0046af6356bb2mr271807edr.270.1669439457848; Fri, 25 Nov 2022 21:10:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669439457; cv=none; d=google.com; s=arc-20160816; b=V49dzlsIhrK4ohS3zQcLjLnWG635rBfkMH34W1KXbF1QF3fXF6N9Q2NkMV/APTkXEP tJ4AfdMdmpA6sq4U0WtlIXcIGSdIybctqp4gkziRCBsDG0Du0ib1cUo8HNaz8S5ZtCET qD1avyv+7Yu+6vWxtEhOa1vqqHpiGCwl73FiKgYgz1bVQZ3zddUSpptybtJIgz5UHJji L5DWFSFzdtu/dcgSkgNZqIom+V5eBSY1tge3nq0wACd++rnHtzoG2hWYiIPC8Pnuf8/d 3SnWbByt5CaVbH0Ka/s6JOhNNwyE8BlW00EaZzxnSk9XqdZU0m+UHGwT+AqwZmDgcgxt kfIw== 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 :message-id:date:subject:cc:to:from; bh=6TeUvswJBftkAn9KXiAd+x7VgDONaksgabzlvyGvCaY=; b=GwWd8u7syMzcIu610RCME7codzG6pNcK8wkwGagr12j9O5TLm5ZPMGCL7rqdJjQAZl PLgqvvN00HD1mCkbDEmt0x/jJIxRq4zue7w8jqwpqxmpy6w8csRYGX0ngebNKD/4kmca z2NYGcsbLGfW6AF6thmmnP7lnDDREfSCc8KronaT1e6XkoJeqk4GlfsFb9eC9YvyJctR xE0CGgmcxCUD2AG37hSagWKE8Gx/hImrq/na1T0X92MI7/1vhB6cl9xmaRueTolYB1yf rCvQCs+YR1bxl1CeglyMy2By/FScrv0/OQC4DjZTpy3pqwb07Ssljr1sKR6PNNU1cFQT /LsQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rh16-20020a17090720f000b007aea2b23ee3si4105512ejb.277.2022.11.25.21.10.37; Fri, 25 Nov 2022 21:10:57 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230064AbiKZEtR (ORCPT + 85 others); Fri, 25 Nov 2022 23:49:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbiKZEtP (ORCPT ); Fri, 25 Nov 2022 23:49:15 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E59F24F11 for ; Fri, 25 Nov 2022 20:49:14 -0800 (PST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NJzgG2mk2zqSdm; Sat, 26 Nov 2022 12:45:14 +0800 (CST) Received: from cgs.huawei.com (10.244.148.83) by kwepemi500012.china.huawei.com (7.221.188.12) 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 12:49:12 +0800 From: Gaosheng Cui To: , , , , CC: Subject: [PATCH] memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe() Date: Sat, 26 Nov 2022 12:49:11 +0800 Message-ID: <20221126044911.7226-1-cuigaosheng1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.244.148.83] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 The clk_disable_unprepare() should be called in the error handling of devbus_get_timing_params() and of_platform_populate(), fix it by replacing devm_clk_get and clk_prepare_enable by devm_clk_get_enabled. Fixes: e81b6abebc87 ("memory: add a driver for atmel ram controllers") Signed-off-by: Gaosheng Cui --- drivers/memory/mvebu-devbus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/memory/mvebu-devbus.c b/drivers/memory/mvebu-devbus.c index 8450638e8670..efc6c08db2b7 100644 --- a/drivers/memory/mvebu-devbus.c +++ b/drivers/memory/mvebu-devbus.c @@ -280,10 +280,9 @@ static int mvebu_devbus_probe(struct platform_device *pdev) if (IS_ERR(devbus->base)) return PTR_ERR(devbus->base); - clk = devm_clk_get(&pdev->dev, NULL); + clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(clk)) return PTR_ERR(clk); - clk_prepare_enable(clk); /* * Obtain clock period in picoseconds, -- 2.25.1