From patchwork Sat Aug 31 02:13:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zetao X-Patchwork-Id: 13785882 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 6F18ECD1288 for ; Sat, 31 Aug 2024 02:07:25 +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=lFik+6mu5VsFZu8AuWvwp481NYNToYB5eTftH9MFnU0=; b=16PVDj6zYdf9RBzhk1DeohqSMS ZMRHG2IjPKiiQy8Y8eD03edNtBHjpaEV4757VOxAikorxCEzt+cPOdfAXkK+LeNk4vNwf69ovDfKs +M0ZXmvmnGv2N0bWrNgyQ8moT8DiVLn+mKIiLRZembMkNT0WZ9I4FlSWC5k2IAt+kT/H5nn0a4916 z71t1PL8hz/lR34lyepjPLJUz2HjAnvbTy9q1/WrRh+N4SbseXL7mLiIy8uSy8Qx9lhX/Ew2CsrIm JOQ47dBTr7K+m3DBty2UYp2MgdMUUYtYZX297qufps8Kj8tLsfGGxXYLEjLeTij4vZGyxvaYRKLOE WzKZ3PSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skDWG-00000008I4w-2y2b; Sat, 31 Aug 2024 02:07:16 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skDUW-00000008HfU-3K5H; Sat, 31 Aug 2024 02:05:31 +0000 Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Wwdb45h4NzgYbp; Sat, 31 Aug 2024 10:03:12 +0800 (CST) Received: from kwepemd500012.china.huawei.com (unknown [7.221.188.25]) by mail.maildlp.com (Postfix) with ESMTPS id E6F5114011B; Sat, 31 Aug 2024 10:05:17 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemd500012.china.huawei.com (7.221.188.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Sat, 31 Aug 2024 10:05:16 +0800 From: Li Zetao To: , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , Subject: [PATCH net-next 00/12] net: Convert using devm_clk_get_enabled()/devm_clk_get_optional_enabled() Date: Sat, 31 Aug 2024 10:13:22 +0800 Message-ID: <20240831021334.1907921-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: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemd500012.china.huawei.com (7.221.188.25) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_190529_351930_2CB8E2B3 X-CRM114-Status: UNSURE ( 7.24 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There are many examples[1][2] of clk resource leakage in LTS. The reason is that developers need to maintain the allocation and release of clk resources themselves, but this will increase the burden on developers. Using the API related to devm_clk_get_*_enable ensures that the life cycle of clk is consistent with that of the device, reducing the risk of unreleased resources like clk. Several other developers are also working on converting to more secure interfaces, and this patch set is in principle the same as theirs. [1]: https://lore.kernel.org/all/20240812160128.338041191@linuxfoundation.org/ [2]: https://lore.kernel.org/all/20240812160135.992451065@linuxfoundation.org/ Li Zetao (12): net: dsa: bcm_sf2: Convert using devm_clk_get_optional_enabled() in bcm_sf2_sw_probe() net: ethernet: Convert using devm_clk_get_enabled() in emac_probe() net: ethernet: arc: Convert using devm_clk_get_enabled() in emac_probe() net: ethernet: ethoc: Convert using devm_clk_get_enabled() in ethoc_probe() net: ftgmac100: Convert using devm_clk_get_enabled() in ftgmac100_setup_clk() net: ethernet: hisilicon: Convert using devm_clk_get_enabled() in hisi_femac_drv_probe() net: lantiq_xrx200: Convert using devm_clk_get_enabled() in xrx200_probe() net: stmmac: dwmac-dwc-qos-eth: Convert using devm_clk_get_enabled() in dwc_qos_probe() net: ethernet: sunplus: Convert using devm_clk_get_enabled() in spl2sw_probe() net: xilinx: axienet: Convert using devm_clk_get_optional_enabled() in axienet_probe() wifi: wilc1000: Convert using devm_clk_get_optional_enabled() in wilc_sdio_probe() wifi: wilc1000: Convert using devm_clk_get_optional_enabled() in wilc_bus_probe() drivers/net/dsa/bcm_sf2.c | 28 ++---- drivers/net/ethernet/allwinner/sun4i-emac.c | 13 +-- drivers/net/ethernet/arc/emac_rockchip.c | 34 ++----- drivers/net/ethernet/ethoc.c | 18 ++-- drivers/net/ethernet/faraday/ftgmac100.c | 27 ++--- drivers/net/ethernet/hisilicon/hisi_femac.c | 17 +--- drivers/net/ethernet/lantiq_xrx200.c | 17 +--- .../stmicro/stmmac/dwmac-dwc-qos-eth.c | 98 ++++--------------- drivers/net/ethernet/sunplus/spl2sw_driver.c | 18 +--- .../net/ethernet/xilinx/xilinx_axienet_main.c | 15 +-- .../net/wireless/microchip/wilc1000/sdio.c | 10 +- drivers/net/wireless/microchip/wilc1000/spi.c | 5 +- 12 files changed, 64 insertions(+), 236 deletions(-)