From patchwork Mon Aug 26 02:12:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Bo X-Patchwork-Id: 13776955 X-Patchwork-Delegate: manivannanece23@gmail.com Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2084.outbound.protection.outlook.com [40.107.255.84]) (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 5D391944E; Mon, 26 Aug 2024 01:57:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724637454; cv=fail; b=eJ42eB2pNuBnKMCB0NySy4lu1kRxAr6p+bS2own1p4L/P+x5YbxPQH/v5ev7KjGCnuJdJAGvkQa7hvV4HI7o35cEuxC1u1YG56+zw9sNfKB/RAYmYI8U+wL7HZ5zhc6PW8bE2Q2PRqdnvgECtQvyh5BEVwU2TggTm1jNddU8+kM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724637454; c=relaxed/simple; bh=AOZNVejSidUXAuWi1XQxzxXtVL6W4noDCU88cgIjyQU=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=mlUUSWimVe5eDdDNVYkd8X9QaGIn4uQMzoVNkkOusnkGIcbRGoetzAlYl7AG6I6snBo/mQrBZ84SUaHO4WY4qeGRqRWHNAC8Uw3M5KrDJgHTQ+zM7gCp2zzdy1iChrV3K5IhevZhDLVscR125FbeHn40rC0BUmwBvAEKu8fbJY0= 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=dUxXquBs; arc=fail smtp.client-ip=40.107.255.84 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="dUxXquBs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KkLI1QS9/vJ+YALMXFkOpkGOjaNkrsGqfLRcRBRSkqIWnpnUmGfNTP0jWdX2UrxoWoD+rQ5HY8H5zUeqGCBi07F7kW1SeRNnCxGNvduiqP/eMNk1wMEwbzqrc6BksfAF6Mjlpe0oBSHujZgLOXz3eUvED5/jBggrJjCKUnV2DWOCh73bWTTabBmsX7WMHDkp0tkzue01ncOPkorNsALJllJvr40YIjMoT222H7XLr0jdACfycmIFJEEBzPToCWpSgcg/YwT7K+6mGdDnlacbn3udedT2+M10/FYn4xg5g5ktbZGxAFXzNY8eJF/BgYglgIptfxZT/der5s8DzoHWSA== 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=7xxi5IS3jRgMgRIC7zMIAqT9ADcIVRaVx8qzJJXy6HQ=; b=OAxwOrunwWh0kIoQoqLFEJR/ox9nt+kuFUV4mdz4mxOOzwjWh3E2ZzZjROK+cJlCsL7ADJQgylkBoHtZMQicNMiuQvRVv1UoO64ZQXQwEFF+162My5gOIeo95RHKuAsx3eK3Vhpei9Lavy3VcwJmLT4eQasrDk1h0OIyLb5LL23SdG6+qJVWhtJSqRAsqEZNA7X+f8q8OIpKOPhRBUDelEpodVVtUfyV7Mbb4sSPvdJY/DzoT4wuRR3Nee0OsuIzHR0Sz9iReypvfyXFviD+2R2s33sFwuRlsxPwVswJ8x088KXtz4/dOkjuRsXUVE04JT1vQJthX+KQOH0dJ6wymQ== 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=7xxi5IS3jRgMgRIC7zMIAqT9ADcIVRaVx8qzJJXy6HQ=; b=dUxXquBsV2GjLzCKziqiKcj0tD47+3OGh7IVkGqYRzNB8yH912RVqETJwOc84ktZJaHuvXPyl3oYY/6lhutbnHT3kOT1Ng7q8Owoi3/IshvE3omlGPKbQ1iVt3jDjMtFA5VjhJ4EUIU1TwGs7gsK4mClS+lSm5XqYmVHJBEAU3klZKLND3BvfN+0S/ILU5sr1ze4x5Ux1qB7fccDOVyKkyrV3wxO0WjQQa8O42QoAqEkM7xZ1mzOQXN6Hq+WkV7RcvSyOcGCRwLnoja3tmtNTOmiJs+Di38KeBU+DqjZPnZcF9TJIxgPa0ID3P6F22iWdgxmKACpO13B7bRE04o+Ag== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from PSAPR06MB4486.apcprd06.prod.outlook.com (2603:1096:301:89::11) by JH0PR06MB6320.apcprd06.prod.outlook.com (2603:1096:990:13::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Mon, 26 Aug 2024 01:57:26 +0000 Received: from PSAPR06MB4486.apcprd06.prod.outlook.com ([fe80::43cb:1332:afef:81e5]) by PSAPR06MB4486.apcprd06.prod.outlook.com ([fe80::43cb:1332:afef:81e5%6]) with mapi id 15.20.7875.019; Mon, 26 Aug 2024 01:57:26 +0000 From: Wu Bo To: linux-kernel@vger.kernel.org Cc: Pratyush Anand , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , linux-pci@vger.kernel.org, Wu Bo , Wu Bo Subject: [PATCH v2] PCI: spear13xx: change to use devm_clk_get_enabled() helper Date: Sun, 25 Aug 2024 20:12:27 -0600 Message-Id: <20240826021227.2206146-1-bo.wu@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SI2P153CA0013.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::12) To PSAPR06MB4486.apcprd06.prod.outlook.com (2603:1096:301:89::11) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB4486:EE_|JH0PR06MB6320:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c1757e1-5ef0-4385-2aa1-08dcc5726f53 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: BdKUQ8YjoD7WCZAVmGoS/mKk9OBvuxJzjfF+kVPFmD5LE6M6Wx+OOg22XO5jQZ+3nvs7doDOIcBok88b54DHcgucLgIC++bKswrVkF1gZf6e2SQ7P3W8vcrgXzhWis50M+B0fbWOkf8AkBnESRYlTaFBOs+l8Adef5JdEpGpZEgbx3wJpEgK+V+RsZFMl4JrNs8tvdgfkNEFOHe4xXa6HbNveQQGDGcJCq7rpkwqMIIGopxGR1VBzfwnjYtzQuyU/wZ7Bz+tUDPafGVgonAoKpWhGXH6B7a7SSm8MxK9HCzEz3hv9as9Aru1IDVyLiYiEI8yqpFEVdN/3ueVOTRBDS7dsP1WWi+RgT9zY6isYWfxhTs7uekaJ9tasEYseCOWW4pC5yI7HlTx0E6wGu4t5e9/ejrQqtDtMg6JSTGuGWG5RvIcI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4486.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(366016)(1800799024)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cv63zFIeUuJ5CGsvJvWxhPppMbxrZp9iuFc1MZZAGBLOtsnBanl8otDPncQeUAWkIhIPIUC08ZQGXE2lz2Rh4/UF3pMw0Ze4BS2G1wHTTVEafizV2484rVRoNWMARNSHw90aprOTkbQDAmytRjDNM+S5maDF6r7INuSSn6wCEe4/fO5QLqyjqgzrZtzGXkVMcLOx2Hr+tQ9BkAJrIGixKHYnYABUls4MgnHJiKGVddP4wMZnH4kovXLsnkoz4HP3UyqsfXoPkPZ6x3bKN1rjjs1FpLn7+abVKPQC6dCqZzVCB/Yby4G32syYn7yE3nycqbc34thqYueTTNPAugZrExEaAvmA95RHu5LxXzgsJs8BEk3NgEZXlveoLI87ybTvAKtVCL1Mal3vCHXvXYC3gdMVSaNkKqc/pnzzlv8xEIBZpN2Ie+Ogi5xNdPIKSJIySMZXqLrPgmmy970Wz65UqJOFbsGQ56oPeZlL2r6VurfMjXBA8HctAGrMMosRCaYEuT70IgfeCTjAOlsgsHaz3yRFIAzusEzSlXp6wmFs1F7aUX9I3RdbIPgo2XcFjKTpwaT7dXcCUCwQlnwBNBvfPygTU3UkBNtQLz6Ppp9Te14qsJ2e6FFubqrM8KEyclv56fXNka+DhXcCPPmp+SXKEWXKAk4GhSUFGuMzTGBfRpat4a3x69n4cGunBkzf3E+dvJM92mQK5PlqVX2kOUsxiST6W6hjaGuHLIrd+Q+G722fFTCr+Z/vBIFGeIMFmjqlWyXciRd36Kd1zVukYc15nmU/nDgsPeQharDvsgyONVc6dkyGEZwUJ4wElPxfUwTmmanZTA/q4BtgnQMOoTwUxAVPs/R8VsS8xgGMTqa2+WbDTQRuzQtFdfXToE9Mn1MxybsLk/tAdVwX8Qqi0J7H8JtxMapWwJFAWcV1MlIBYjkcRiXKOpXY9RggI7H9Ie9gBY1OQ7rT1V/lrl4pK+0+7FuKCDIGrT47RLQiMcpprt/B/e0kWJuecF5z0hnd/mnUnIiNxCBWSBDrwz/T9nF87TKWsb2nEBDT/gV9ezQvPpDF9deKzVBcyLjgs+PC66rKpfwove/IRvm6SQEThgYvemfHOY7pPcM5wxhVOtV7GMOdW66fuK0AnMoLZoZjznZ2BfUfa0ep3wKVovQ2hcSxreybH1R4T0FFnnSbe8Mk+2oKOhaprv+jtOo1uetDXeY3zA9dRDMpj3R4i6gNo5joHymtYU0WP6lpEFiQOh6THgHKMPRp4tUdhdYDVyUBNfIwWjR1LitOiV7DTNbtndawF9bgoA5wLcYBodTmMUokmvEyO+n2eXVzaNB+0knXbl+3hOuN319kCiIgmgjObgsqKztKzJTHfFylVC7MX5YjDAIms4I61zLRJXe8UaQ3KUKbxvWY+zpvmu5VirQ20Ur2llCLoVe2RbyVB6nRYH75zXnXLAAgqwwbm74BgqAH+ife2LM84Eri9cF1dDIV3t8hvAWd2PTM0rYZBu5mFJ65WR3xuge1eGzy4Hy7KjlVtY2a2owjKXT3MI3oTIuIiYMU6JfG+Q6iTz3/Y0lkNCozZxfNmG3A1vvUmz1w3t+ylk6+ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c1757e1-5ef0-4385-2aa1-08dcc5726f53 X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4486.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 01:57:26.6038 (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: UDIgZ8A3ejyl/HrXpiDw8fSDUEYoTPct94CbCdJnLH9GdfIUV/xWVPkIJ3Lt5q6SlPgGyULccVLsLB59VW0O9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6320 Use devm_clk_get_enabled() instead of devm_clk_get() to make the code cleaner and avoid calling clk_disable_unprepare() Signed-off-by: Wu Bo --- drivers/pci/controller/dwc/pcie-spear13xx.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-spear13xx.c b/drivers/pci/controller/dwc/pcie-spear13xx.c index 201dced209f0..37d9ccffc2e6 100644 --- a/drivers/pci/controller/dwc/pcie-spear13xx.c +++ b/drivers/pci/controller/dwc/pcie-spear13xx.c @@ -221,32 +221,18 @@ static int spear13xx_pcie_probe(struct platform_device *pdev) phy_init(spear13xx_pcie->phy); - spear13xx_pcie->clk = devm_clk_get(dev, NULL); + spear13xx_pcie->clk = devm_clk_get_enabled(dev, NULL); if (IS_ERR(spear13xx_pcie->clk)) { dev_err(dev, "couldn't get clk for pcie\n"); return PTR_ERR(spear13xx_pcie->clk); } - ret = clk_prepare_enable(spear13xx_pcie->clk); - if (ret) { - dev_err(dev, "couldn't enable clk for pcie\n"); - return ret; - } if (of_property_read_bool(np, "st,pcie-is-gen1")) pci->link_gen = 1; platform_set_drvdata(pdev, spear13xx_pcie); - ret = spear13xx_add_pcie_port(spear13xx_pcie, pdev); - if (ret < 0) - goto fail_clk; - - return 0; - -fail_clk: - clk_disable_unprepare(spear13xx_pcie->clk); - - return ret; + return spear13xx_add_pcie_port(spear13xx_pcie, pdev); } static const struct of_device_id spear13xx_pcie_of_match[] = {