From patchwork Thu Aug 17 02:44:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zetao X-Patchwork-Id: 13355915 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 2F763C2FC14 for ; Thu, 17 Aug 2023 02:46:15 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=T59cwqmmksnE6DxPk9+yXk2mEgsZG7CyI2p/ZhnwoiU=; b=Uek7XuXOoa1fkU P9rEN/XFHOobWIMTHPBwiknnM6UasVXgQCdZiEcG8OC8tEE14BRpZUpBUBU7lcMcZVmrmHYqdzzty OPGZuev4ZT3HEMqcxxYe/rWfjzMiMNGgHzVYLwljglXuJq+vN/J3iz5gOPcx1F/lhcQhbNRC3p2l4 03kiv3j3CeulPCBR77naFvEzgb3Hltwvqirm2fnr2McpUk70DlO20at9ONNPhoA1Rnn2xickEs9aG iscXGZ2ACd/sdOKlXHB7cJZkzOR2T18qK58bfz+oeSmBqpO8YtyZON5snJDyUwLWST2hfVSn6Ktta 19B5RYA4CuFPIb9Np/qw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qWT1F-005N7k-2M; Thu, 17 Aug 2023 02:45:53 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qWT0z-005Mxl-0j; Thu, 17 Aug 2023 02:45:40 +0000 Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RR8R63hSzzNn0t; Thu, 17 Aug 2023 10:41:54 +0800 (CST) Received: from huawei.com (10.90.53.73) 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.2507.31; Thu, 17 Aug 2023 10:45:25 +0800 From: Li Zetao To: , , , , , , , , , , , , , , , , Subject: [PATCH -next 00/11] mtd: Use devm_clk_get_enabled() to simplify the drivers. Date: Thu, 17 Aug 2023 10:44:58 +0800 Message-ID: <20230817024509.3951629-1-lizetao1@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230816_194537_774305_97C89CE4 X-CRM114-Status: UNSURE ( 6.15 ) X-CRM114-Notice: Please train this message. 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: , Cc: robh@kernel.org, paul@crapouillou.net, dmitry.torokhov@gmail.com, philmd@linaro.org, geert+renesas@glider.be, martin.blumenstingl@googlemail.com, yangyingliang@huawei.com, lizetao1@huawei.com, christophe.leroy@csgroup.eu, linux-sunxi@lists.linux.dev, rogerq@kernel.org, linux-mtd@lists.infradead.org, u.kleine-koenig@pengutronix.de, christophe.kerello@foss.st.com, linux-mediatek@lists.infradead.org, jinpu.wang@ionos.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, heiko@sntech.de Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks") provides a new helper function for prepared and enabled clocks when a driver keeps a clock prepared (or enabled) during the whole lifetime of the driver. So where drivers get clocks and enable them immediately, it can be combined into a single function devm_clk_get_*enabled(). Moreover, the unprepare and disable function has been registered to devm_clk_state, and before devm_clk_state is released, the clocks will be unprepareed and disable, so it is unnecessary to unprepare and disable clock explicitly when remove drivers or in the error handling path. Li Zetao (11): mtd: spear_smi: Use helper function devm_clk_get_enabled() mtd: rawnand: arasan: Use helper function devm_clk_get_enabled() mtd: rawnand: fsmc: Use helper function devm_clk_get_enabled() mtd: rawnand: intel: Use helper function devm_clk_get_enabled() mtd: rawnand: lpc32xx_slc: Use helper function devm_clk_get_enabled() mtd: rawnand: mpc5121: Use helper function devm_clk_get_enabled() mtd: rawnand: mtk: Use helper function devm_clk_get_enabled() mtd: rawnand: stm32_fmc2: Use helper function devm_clk_get_enabled() mtd: rawnand: sunxi: Use helper function devm_clk_get_enabled() mtd: rawnand: vf610_nfc: Use helper function devm_clk_get_enabled() mtd: spi-nor: Use helper function devm_clk_get_enabled() drivers/mtd/devices/spear_smi.c | 15 ++------- drivers/mtd/nand/raw/arasan-nand-controller.c | 29 +++------------- drivers/mtd/nand/raw/fsmc_nand.c | 8 +---- drivers/mtd/nand/raw/intel-nand-controller.c | 15 ++------- drivers/mtd/nand/raw/lpc32xx_slc.c | 12 ++----- drivers/mtd/nand/raw/mpc5121_nfc.c | 11 ++----- drivers/mtd/nand/raw/mtk_nand.c | 20 ++++------- drivers/mtd/nand/raw/stm32_fmc2_nand.c | 17 +++------- drivers/mtd/nand/raw/sunxi_nand.c | 29 ++++------------ drivers/mtd/nand/raw/vf610_nfc.c | 29 +++++----------- drivers/mtd/spi-nor/controllers/nxp-spifi.c | 33 ++++--------------- 11 files changed, 48 insertions(+), 170 deletions(-)