From patchwork Fri Aug 23 02:31:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Bo X-Patchwork-Id: 13774500 Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010032.outbound.protection.outlook.com [52.101.128.32]) (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 8D963947E; Fri, 23 Aug 2024 02:16:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724379373; cv=fail; b=QMgDJFuGQgAJhMTeqYVpMCfXOJAvTWsaMlXXdJRzx+yKmx/j6w1mC4hcoIZsWalawg0vaKVRwKjNk6/yvCtDU/1bNOzIgYQj0DcQOFmSj3HIE/lnslcqOtDSL4CG1iKeTP1F3Ulvcy444G06F20HQIzL/VnGF2GoW0qhblFj2wU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724379373; c=relaxed/simple; bh=ZGwzgYbMjeJ8sYdpGbCxo+UgtxVHpkrk/VrwaHzrABc=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=Vxy8QeygRXKkfEn4+ZTrNYf0lryvh7sgPSyYdjm8anelbFAFa5oGWi5BEXdiXyQTN8DQRtktFuI8p42yYpUshnO16YsxPeS45cNw8JewE0cEPI2ItQRt4hIA6gqutZ7JzOAV+ZHo83rTeON/9BroGV92mauxGFrdQNynw9rEve8= 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=qEWEm2Hs; arc=fail smtp.client-ip=52.101.128.32 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="qEWEm2Hs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p68bt5seOHEVs1+KzXCEp/clY/M3PFMkgKrif8KzheBksQfuth3rIDJqZL3x24Tx0pW9EWWnoRrrZP8tHez4xL1xUhQJIHvxZI1IINOSmq1Ut+JC9M0xSDVsfctpQGA/DJQznPFGyG6DfLWbzuulZlVm15Etc5+7ejkwEUk294E90Bv/0lsKEpM+6gzcaOXS8Fy9/KLk8TykQPGBpBKmFNYexjepD2NrviWj3allc/rlE0O+aEqLxyTjfWpG88o04PizmxuzrMSr1HYzilvoqYNYD5gaMKmgKiRkJ0UYQI5y6Fv/zi0LJaatBy81Nj9iTcZkAzTqSqu13xk1+dxIYA== 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=OLq48GqfWEDBKqzUrSkeOSZEnt1VnKAevbXpe8wvGsk=; b=KPJzAHV6H31OqDdeW9A07o2G4en6JVlbqrAxVT1w+BuEGPsMSTjTWA1X8l7H/td9l2JoxhPbkoDhHCZgEdjlq7c5Lcrv6UcG+h4tdieKADEIjIs9FMDS4XgvO1A+rEDZxUMcaaoSNv7CKbMJ62jJx/TqNcZk2DNmZZbbXPFzdVIRQNuRqlFl2V8lYRGG0rPbrPEZKIXIU8eNF0jRO+IavrLd3/zH/9xARj8CqfHGUGXC/VqYu+QoYHArmIlpZxg82qqOjqZTSjbVWhVpqdiP0/29d8A2H99pERt518vg9mZBWu0UmwUv3+HcPaPC/DuphIbiWPB+gqfvDIZmC4j03g== 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=OLq48GqfWEDBKqzUrSkeOSZEnt1VnKAevbXpe8wvGsk=; b=qEWEm2HscBvFicjyMHQbwdk4TQPCfoM5/hKKVZzogfCFBHrQiqVXDF+IB9CvoUan1qIY5thDyFlQEPC99ezUw2wp4B6i7e53LtjalpI/da9jEmoADTM1YChL/JqBDw2jPVXd3XdQOISknr3e2nHKS9QZEzvIG3Vj+MsTahIczNhdxllisyk/YRHcfk5XLg82S6CZv3zxYGhyvi5IKMQS2rkmXtE0jwalnLA47vL+dYYldqZibOsBHaBGD4gbwHB06dzz5YmUwqssR5VZjLmk2uVFGEaEfHZQHVR+K5kVgDzkk9/zNl6ugX1MJmGEfk+WTSrVJ6nJOVScR56iG1ZJsg== 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 TY0PR06MB5779.apcprd06.prod.outlook.com (2603:1096:400:27e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18; Fri, 23 Aug 2024 02:16:07 +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; Fri, 23 Aug 2024 02:16:07 +0000 From: Wu Bo To: linux-kernel@vger.kernel.org Cc: Serge Semin , linux-mips@vger.kernel.org, Wu Bo , Wu Bo Subject: [PATCH] bus: bt1-axi: change to use devm_clk_get_enabled() helpers Date: Thu, 22 Aug 2024 20:31:03 -0600 Message-Id: <20240823023103.1984437-1-bo.wu@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SI2PR06CA0015.apcprd06.prod.outlook.com (2603:1096:4:186::7) To PSAPR06MB4486.apcprd06.prod.outlook.com (2603:1096:301:89::11) Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB4486:EE_|TY0PR06MB5779:EE_ X-MS-Office365-Filtering-Correlation-Id: ee4684e0-1fb4-4d27-6d55-08dcc3198c07 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: 8YN6dljBJql/CKiZ7C0ZXv1DAL/nI2HMfjhJD0jpsmC0Bdj2PWnaC5Rx+eVtUOouc7C9Z5tTfv+VTwXStU7mW3WIQ6hLgWEHIB6PX20qv2kikkRe88Saz/wYQmpaLAXUiy35tq/gUar0/NOMpM2xvMOw9eeN8I2mWJ0N4z6VdiMml6MTdTYZJAaLYGG24U5oKiSf+bsYVTnWfoH3XDPMuyyuOpwhl4raBCvHgYJfg2E4FjZvJsBc2zvBSSjy1/irc0VLdOiG9jOD5ejpo7VK1di7YMfhLroQbgiUtUyzZQZsfpzZ5CMEf8CaWGvDYDuuv2S13XFia2F/4Fplk5HK2RX+ZNvJaFzDPcElZxBNBhxpFYXLlz37qB2QAmBZXiyJbtatTKRqhHrGTCSLqujFGrTFqnFJefP3l2KKx5v4yQUM+Tkyd4lSWpz1/zX0Sep5pvlWVAlzJbpz7Ev3hEkTtiQR6/meLlEvzPmLPvHZkzWU196ttT6OaEWShp1JWveO1W0qNgk+NaPRlIkJ8F2UugTpTEHJW4Gn62qRbA00gtcR147VLAj/Zzwvq2Ruyh2vYVFK5UCqfDCRs5vsEU/fU90fGR/sQ8G3QF9L2zB2Ls7NWwbeEP1Zn9vZhRIN73fLsRvCGJJaS27CGbpdL3aI1sq04WFBRoaxjymiMKVTQWhsvoU2E57Qw3OqNzfDfJHV38YQwEI2AVNCG0wrEui7cNGrNszwYcNmbs+OkgzG0GXpNKU8Y3PgF/6R99gAlRgr8rvEoOm20QD6a+vmMkU2K/+lt5630vurWH29udFh1JhxcDG9Nb5+emOCHAfCWE6VOAvKZyqffCJ+vc/Moldv0AYqgjWP6hW6Rt0K5iTVu+IcuW0V3Mwh2MDSW6+ohnEVCzrzNESqUvFzxYc7bqgZZUCQPc+vx0Q93vxjOfxdcmsVzgZgVeMfzNVjG7VPJ/cAyDon4xkUOTKgXd4Bze0g6WTwTwVz8vEvmHW20Eb1xugoHQpSdUiuf2bi7bGh9I4JFMxehlvMiCIWAc15TyE+EepAyPtBcenRUTgwkfghQaTBbCCodzdV99CF58ZSTvCOLeIPpcVxgXXd6zdeXUiKU5WGS2uhanvLohoHKmX5Ncgb/YRgAvqv3arOM1P/SQos+5S5mdBLmvXWgkmLVvDcW0+JEtNouGPNLm54SbE8tWfG875Bb3nuUGM88ZoGQJypFNS3LRSBhFisd3KdYE+hOg0dKmNgcJKg6He4A/u7y+yXiJ/QSyIyZVLIp/5qhWNFO5VCbQJ52T9jfwBlxuhi/Xl2RA0LPB56k7glePAai6qCYW+WyxMjGnvRUb/rs1BgtbAnf4x2yePQa1EK+8icbywHGhuvoVScPYPOclb/GLCYOLDVF4BTmoRKlo3XE3Sk/N3aXrEFzPacXySWkGOxtg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PSAPR06MB4486.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-M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DwFstXmFnkpoTWGXIk18dTvP2Ic8tpKCh6N2zm+X1K1hUpkecW44ea7nz0LmfIx0+/ODSj0Vz9/sZaHG2OJHm2GfcCWGREmQERcUSAxtTyywkYnuWhrsYmRjtS2XCFuYmsQEZk0V4wySVrdudwj47LMsXoylOuq1PTDip3la9qhzEZm0hruxmQbuLKkZlvMsBl1mJ9kd/JiQ3UOamotHke2IVT453BXJGlwcybipnKlRcDz7eqytPE1FfJS3Vxd26zt3xAImi381AUCMgMZRho0DPgOaG9pZVfwwlZuZwEW29ioRPj6B1SwSQRf01yCPKKVkB4cHLO2X5ykUbLCuOHSrFgP8EVrAorJkJ30jLJa1QlEEHPS2mpaGZ3zABvOqcnPDuumahO55kSVCGnSzFcmhuxCSAYK/Jbk8oJjIBYuAdyy2TEzv3cALjKhHbNUpaqi/xqKG5XWuhBDG+HgxQF5GRi+5om1OQrr45fZXexPkKC19siqtLll6MoiL5pFwo9GboEzXzhD8U5Lbrl4lmR23v X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee4684e0-1fb4-4d27-6d55-08dcc3198c07 X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4486.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 02:16:07.3430 (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: mldEJ7p4ccQcDY9BqLHVKUmwg1o3avatcm+gM1Baq1RWv79uqhVwf5sCrdI35es6USg0+9jrix0cU48e1va5YQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5779 Make the code cleaner and avoid call clk_disable_unprepare() Signed-off-by: Wu Bo Acked-by: Serge Semin --- drivers/bus/bt1-axi.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/bus/bt1-axi.c b/drivers/bus/bt1-axi.c index 4007e7322cf2..b0baae49aca6 100644 --- a/drivers/bus/bt1-axi.c +++ b/drivers/bus/bt1-axi.c @@ -146,32 +146,15 @@ static int bt1_axi_request_rst(struct bt1_axi *axi) return ret; } -static void bt1_axi_disable_clk(void *data) -{ - struct bt1_axi *axi = data; - - clk_disable_unprepare(axi->aclk); -} - static int bt1_axi_request_clk(struct bt1_axi *axi) { int ret; - axi->aclk = devm_clk_get(axi->dev, "aclk"); + axi->aclk = devm_clk_get_enabled(axi->dev, "aclk"); if (IS_ERR(axi->aclk)) return dev_err_probe(axi->dev, PTR_ERR(axi->aclk), "Couldn't get AXI Interconnect clock\n"); - ret = clk_prepare_enable(axi->aclk); - if (ret) { - dev_err(axi->dev, "Couldn't enable the AXI clock\n"); - return ret; - } - - ret = devm_add_action_or_reset(axi->dev, bt1_axi_disable_clk, axi); - if (ret) - dev_err(axi->dev, "Can't add AXI clock disable action\n"); - return ret; }