From patchwork Tue Aug 27 09:57:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13779152 X-Patchwork-Delegate: geert@linux-m68k.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2079.outbound.protection.outlook.com [40.107.215.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B378F1A00D1; Tue, 27 Aug 2024 09:42:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724751768; cv=fail; b=RSaRJwxWEA/bYNMlnEDIzvXNLLokoeKn/NaGYw9yl35tJItWhEwGlzeA8KHJA4SzrtHV9h+myD6x9So0ivK+arWDcNfT5f9LBfEt3Y3ftHNp2Dsbk038yjbhSldc3c9oCxNnkOV631H+lBEGQQ+/plDUc+Z/WFweSAL93GCz154= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724751768; c=relaxed/simple; bh=lam3i1C/fKVtSspHCt8lTEW38ChaahKD5MaeZy0zAN4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Zv8VUe4Sw+8/sAZG/kYcgz6QOx+WxDZ1SSIR+vH9SDbWL15hPgmvxSL6j7pACeusrDB2MpCM/xmnDCz9B14Tfeb123D+6IOUc+LXFzW7X83cWPNNyRqsjNHHht+e/tGO5I+7fluVYw343Uftf9t8PeevyQKNr1VYPxDX2TISY8o= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=DBWIgqmJ; arc=fail smtp.client-ip=40.107.215.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="DBWIgqmJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GOrKxAx5dvQm7AJFPUlm+yw2t5aix3MSj2eU4YtDsPcs7fb3dR12oO2A9kn7nBK6lkQALwrmFgAIGZbIC1vGkwAFug7AJgYsiC3gGhwi8YFeUhilIhL/wlYJC9LL/UpIkbkhSSxJ1UNZkt4fPIztL/kruqs0J3oCJtC4I13V/UGtmfJkKEvsd/ImU7TZcdUjSvGJ3fOB4wwMSRmQmKZJxrxnahca5MqK6kTDPdJXjXXF6kyUjIlsAuYwGIqu73s772WUVhJwZVHPtXIuiahX0XU2TLv5L/EuXmBM7L9L+z7qV7E+HHZIH6zFo6rLDXYjly7Q5GAA/CS0VWZRVZbb7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9ClWPIRRFkyW/ETzB202vCf3b9EilvOpJIebbhY9/zg=; b=PRGzf6Qprip/x/g9raGWgQj33IWUS4tyxFmwNd01p3C+LhL4fzGmG6IyrF9K0jI6WH0isb9sPB4XCOXMm/Rnfm/cBIaS0y289MED3u+DhMrZ4LrNPMPDT+a09BUI8HWuyk7991hZWPNX9mwqgTXPmiqWiQ0VHK2K79clyACsSGXo7JoI+/Qq4tymafolAhJ3hM4vzaXt+4DEnfCfxOCcZALLNAx4MiFLWQpiqBb/1Pi4N4wntU/khmio6SezV49c5xPfmf8dPZsRrQOpG/z3DuchL9DjSBo01nKKIMtjkHQ6wlfPblxYEdSRR8DNF4oTlfDG+E5yRgsKWHoe+thDQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9ClWPIRRFkyW/ETzB202vCf3b9EilvOpJIebbhY9/zg=; b=DBWIgqmJuOD/YLZLMe1bpTHzxB6XeikJ2cBrppBOXc7bOxi0Qw/8jsKBJU5ojFAKeacKnmpjRyKhcj6nhcxuKmZh0NcTYyAOhrhDriObiGWv1YyytTw06gcH23owokP/L2gyg4Bx5mviOI8hXaQfDG1blQnL2yOgyuk8F+EVJB2y6rs1iQpOnjZ3HhiN7XBes+K5gdQ9BeRPwl5e562a1RbfUs4CpVvZb23OdHlMpdreBlZ7AVYkS47h0lkcMZEc4lSvZjwxLkKiWKck8M7AsHbQ/iMzTPbvKuSfOYzZSC/Ygd/uN3uUCieEdv9Cal+667TDyCS9ajNQpiT5sD10Fg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYZPR06MB5734.apcprd06.prod.outlook.com (2603:1096:400:281::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Tue, 27 Aug 2024 09:42:43 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::8c74:6703:81f7:9535]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::8c74:6703:81f7:9535%7]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 09:42:43 +0000 From: Yangtao Li To: clement.leger@bootlin.com, andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ulli.kroll@googlemail.com, linus.walleij@linaro.org, marcin.s.wojtas@gmail.com, linux@armlinux.org.uk, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com, hkallweit1@gmail.com, u.kleine-koenig@pengutronix.de, jacob.e.keller@intel.com, justinstitt@google.com, sd@queasysnail.net, horms@kernel.org Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Yangtao Li , Maxime Chevallier Subject: [net-next v3 7/9] net: ethernet: marvell: mvneta: Convert to devm_clk_get_enabled() Date: Tue, 27 Aug 2024 03:57:10 -0600 Message-Id: <20240827095712.2672820-8-frank.li@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827095712.2672820-1-frank.li@vivo.com> References: <20240827095712.2672820-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0053.apcprd02.prod.outlook.com (2603:1096:4:196::16) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB5734:EE_ X-MS-Office365-Filtering-Correlation-Id: 3684bd01-5c0c-4750-01fd-08dcc67c99be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|7416014|38350700014|921020; X-Microsoft-Antispam-Message-Info: gPQ212Zl+TePH8gbqp9W9V6C8/EeV414BlYhiuHgW10a9MCJNrMza9nrPoa84QozrGToOdrTGAr1jpAQSd26Z0AKSBWgR5YMfajCu9GICBmssHk1Ebr9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nqnEOyYr6224jLCemutD64GF7MYXKVRwnrURtnaWFBb0lkcZAz4vNU3QMuECIS3ZY+hASU8rBxqCEp3KqrVNdeTp/sM25LToCRV9eeJvwXtayJ85kwbVm99m7i2MMC7D2lOrcG623JedpcFrKt9AsknOSR89XY8Iaft8SG8dHjwi60bHjvcnkg/sS8y0V/bJqvNmd0mO8lmW1cOSk6jiLxZ88SEFh0C/Uu1KvZI2Auh8bxJLhMNC5IKHY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(7416014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5ohhRJ5IFd6w/q7Bug5h5lZYv6sAIvKVJT4xj62ie85pniHBt2YCP2yHAizmCCLACevsJYj6m4kccerO7pNCHOg9Q6qtvF/hOQedyCSgPIJ/DdSush/SAHdhM9ZdoxHVHXnLIcKF/BzZ/w4vyWwrO4OugNd0Icm1qKb4y+W3JCi6mf25VeD2fnhG8jJY/vaVzdbnxtj3pt6XnQimiPRQccVYQN+GpM1HtZDuAoNB2med6UojP8sXITRmopHwINDtROhyHmbSriqCW2kvCgVCnOGH/KyjPFNfAG+2kdkKxsF7smUzHRmDY57iqaHwsrNnTwOCL9uc3NflEh0hW6RDLeeYtMQm/QQpwqQsf24XWjAmirdnsOEUdGyuskSjdxvoElP4jQ92xlDZJgDFS/FZWj4QbE3SFGYK/NMQhbk5eyDBRXll7cT98pKYnnkk+JOjZu88VWiEKce5fZim3mkxGyr5r3ZoCZZv3OxkjquSvMmMGkcbUEfSsS2Y1Pr6sFStkdAF5KXVTF5SE6DKc+9EV7ZvBM2231wNfUIyAmTp7ux54qopkwih3li+JjX1oE8x+PFLPLyPf6xUEhJqffXAP9M3KQ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ossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 09:42:43.8705 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3KOexM5VaI16l2iA0YCn+NYlXjux3aEEUDL9dq7DK0/NXEt83YWrUvFeXCezYg44mPFymegkhqnHsanel18dzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5734 Convert devm_clk_get(), clk_prepare_enable() to a single call to devm_clk_get_enabled(), as this is exactly what this function does. Signed-off-by: Yangtao Li Reviewed-by: Maxime Chevallier Reviewed-by: Marcin Wojtas Reviewed-by: Jonathan Cameron --- drivers/net/ethernet/marvell/mvneta_bm.c | 16 +++++----------- drivers/net/ethernet/marvell/mvneta_bm.h | 1 - 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta_bm.c b/drivers/net/ethernet/marvell/mvneta_bm.c index 3f46a0fed048..bfd1ed12d98c 100644 --- a/drivers/net/ethernet/marvell/mvneta_bm.c +++ b/drivers/net/ethernet/marvell/mvneta_bm.c @@ -411,6 +411,7 @@ static int mvneta_bm_probe(struct platform_device *pdev) { struct device_node *dn = pdev->dev.of_node; struct mvneta_bm *priv; + struct clk *clk; int err; priv = devm_kzalloc(&pdev->dev, sizeof(struct mvneta_bm), GFP_KERNEL); @@ -421,17 +422,14 @@ static int mvneta_bm_probe(struct platform_device *pdev) if (IS_ERR(priv->reg_base)) return PTR_ERR(priv->reg_base); - priv->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(priv->clk)) - return PTR_ERR(priv->clk); - err = clk_prepare_enable(priv->clk); - if (err < 0) - return err; + clk = devm_clk_get_enabled(&pdev->dev, NULL); + if (IS_ERR(clk)) + return PTR_ERR(clk); err = mvneta_bm_get_sram(dn, priv); if (err < 0) { dev_err(&pdev->dev, "failed to allocate internal memory\n"); - goto err_clk; + return err; } priv->pdev = pdev; @@ -452,8 +450,6 @@ static int mvneta_bm_probe(struct platform_device *pdev) err_sram: mvneta_bm_put_sram(priv); -err_clk: - clk_disable_unprepare(priv->clk); return err; } @@ -473,8 +469,6 @@ static void mvneta_bm_remove(struct platform_device *pdev) /* Dectivate BM unit */ mvneta_bm_write(priv, MVNETA_BM_COMMAND_REG, MVNETA_BM_STOP_MASK); - - clk_disable_unprepare(priv->clk); } static const struct of_device_id mvneta_bm_match[] = { diff --git a/drivers/net/ethernet/marvell/mvneta_bm.h b/drivers/net/ethernet/marvell/mvneta_bm.h index e47783ce77e0..396dced914aa 100644 --- a/drivers/net/ethernet/marvell/mvneta_bm.h +++ b/drivers/net/ethernet/marvell/mvneta_bm.h @@ -94,7 +94,6 @@ enum mvneta_bm_type { struct mvneta_bm { void __iomem *reg_base; - struct clk *clk; struct platform_device *pdev; struct gen_pool *bppi_pool;