From patchwork Tue Aug 27 02:49:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Bo X-Patchwork-Id: 13778732 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2056.outbound.protection.outlook.com [40.107.117.56]) (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 1C110372; Tue, 27 Aug 2024 02:34:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724726088; cv=fail; b=qwfnMr5diULvFk8wvB4AUdPawfYlMSnFexbA1m3l3YnM3bO8ftdKrZLbtWoembE50j6XyQvgneGH3QHcXhO5AOLLHQuPTth8FODF2fnsmMS5m5PZOJnFspQFjQfZAmEyAg5Tlmnrou1t1ucO+0m93ZGDFQL8sRCx8DsHMK3F5AQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724726088; c=relaxed/simple; bh=sNylu1N/Ikrp4oCwvt+ZUYJMbjCLIpSmcwzrdUoD31k=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=Tk+gI6fkM73fVYB0AOH7Hz2uVDIgK9iVOqXDrDQzUjOlev8QWFQ8mvZRr5NG4L//qXDcS+AOLkGj4+WYxRuumP2YeEOfB9sfZgX0uG0JjAn8wgr+7VMqpgizK+E9H8AlmaqRxFvrOQXZuHoxpAj3xUV2R4EsbT5Ruh6/FUTDycI= 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=KQoZt+fT; arc=fail smtp.client-ip=40.107.117.56 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="KQoZt+fT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bzYGEdB2Y6HsB77XT6BNumhPm4BV4fyR4iyyqksbSTbG/lHkOKhhC6ecP4m5Jh3dXX0xwNzul7aha85rHrZrPNmBJDW+9aowUdas7XXiDSeJoLJvgUnGOJs7R0wMgkj+VsPmvpasZhaxiEZyCpTL2d7gXk1acqIRwwljxMRhzNnP5q9XThXdpAZklcZ7VxrDmR0YnIhTnGXuDDE3eARmEtbVXNHrWcbyn9sD66QV6Tz/nkYS6mT++0/otSQNlNMBSyY+ooX8B+sS6k6T9p1RPqr79X6sOJDQ8Tl3fkmLt7AgmMPHYVWgFUJGXqzaKkIjTR1lksYDVLGCsttTRyq31A== 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=1DWQp5+9GB7Rsvx8B+9UtmclLvFPjkwrn8LJEjvlqz8=; b=GRrT9X9uruorX6jJ5LlUnzi6DCSdwr6qtThoTEuIlNQnjhsO4bxQTnCqK0sIgGDhu7ZICBOfCXNmFWqTvPh/PpnINS8QJ7LkuV3vSq4Z6FlNo5+eZ69dJKTHaEps+pusP7QQe1nVgHatY/gTnRvYg0yNuIZRz/MRkJjgvcqK/90/89ynxLD+fbeKtKxFZyjIfrd6rM2w/xpX8vOVU1CmEHdne97ZMuoVWTY83S5erOuiUVsU+qWpCc65CAp99eLfh+pUDYYtB8z6tNn/S9ogivlG1txlVNs+oLXIYIOQSTzFpmDoJN+9ZZvy7zGBTuHzO1Qw8FP+4FwN6DNYprNtRA== 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=1DWQp5+9GB7Rsvx8B+9UtmclLvFPjkwrn8LJEjvlqz8=; b=KQoZt+fTs1r1zKPbyakNtDOUKadylQSpego5BJZfw11Ga50RbKqiI3hv40moJuRxrrrPYW9Vrb+ZSU4ZzZFvGTAT1mY4qxs4mcpAVgkDB3JCOC2o8Mngk/UOHgvwK0QqaAuBoCwGjUtKY8zLUiqSFDwwbwFVmhR75GVBnMM2hfnJ+BKJMLRM47c/lKLxqDSHyVGWlhqoaWK+8/Ld0zxtoH4X+ZCRIULKIYARUl8DcLO5uBxstRTWn7AO4uJkcbdfdbq0G7vnKRN+1U7o42WAzBtJ7ORj2GQfA7Gv8CpvIMJu5qfEz/CCxwLzvUHCrJyD/FtkrkYXIaWMH6dSz5+bxg== 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 SG2PR06MB5214.apcprd06.prod.outlook.com (2603:1096:4:1d3::13) 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 02:34:39 +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; Tue, 27 Aug 2024 02:34:39 +0000 From: Wu Bo To: linux-kernel@vger.kernel.org Cc: Serge Semin , linux-mips@vger.kernel.org, Wu Bo , Wu Bo Subject: [PATCH v2 1/2] bus: bt1-axi: change to use devm_clk_get_enabled() helper Date: Mon, 26 Aug 2024 20:49:44 -0600 Message-Id: <98e5fe3c7762f3c2cbf7b2f3b3461c0cef789dd6.1724726725.git.bo.wu@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SI2PR06CA0011.apcprd06.prod.outlook.com (2603:1096:4:186::16) 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_|SG2PR06MB5214:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d031f72-d463-432c-19d7-08dcc640ccb4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: cNr62vWl93k8Py2NWunVNO15CIMbkknl8blmRRLtm2DbaZ/4/YAgur7mZwYMh1J5AFrUcsP8Pt4eV+TohtOjqK1oYVR74BizpZvnqr4ZJJpQYjCiG1NCx51dxrdnohIu2OdEizPD2CorAsxJmCK5dJfiNBTk1p5N/DTK46vWvgT3SAShwHoC/yEWNbaM02Qobod0yKaRAQ/CxZU30s8vHaEOBLAKYYYluWDXOyv5MyulcAlFOJ8hSEFhu8V4IcSCUVDEuGJ2GsQSlQjOoe5vPNlGDNHl+cWHSJcA9qiowBOPPXJ1JpIJ9sdiM7DrPBYu8RZqwi2tCZqR8YivmXt4FN/3H19XFdZnvRR8QOLbnHtGivyxJUjbyevex0xKdmBkATU/vZjBpHAmXOHpOiIVp9pDSAMPmzDHgyPMSH4MdKew7YUtSdKdNQ7GePUz7vn+hjUGJ4yuAsL1d4WawQMLIKUL6mffMZHlE7FOhNRzv7QzclYxl/PMStFdX+irBqm7PviZwdn/OgxPpi3dxU/6e8jhfejIo8DcHmaNGYgSb3KfFu31qtVqOHouSgFf+1oFou4rNOOFRhnL5oH0SWp05RV4BnVse4t/PVtwPsgi4UKXSFzn7sY2VLRV7zKEvEApPcJC5SjRg4WDmlMwT9IsK2bL68qmwt5+9ZZ0iNmB0uTe+H8fghcf6mLiro5HO72ZOm8PrVa+ZFzO4F9XJoY8vQACGN4NzElSWYoE0dZlo8illK46CEKlWeZcZTAMJMl8B8JjAjN3VREJWSCoZfIgRo6DeROfADiYAUprGxU6Pv0EQtov12fGEvR9VqCCV31S0RXkGrl1OQNo2kD/2ZVsIToBASLeEgokHkAWGaNR7skyhnK8lRrzPxzliuDIAUTbAsG7E+quGq59nmlz/10CVE9mQRBNHYTD/R6R0EifDVfjA75F5eHyLLZsNHuMjlcogy5U1KBIwqAlcPcA4AP1x57IUlbqRzsr2Yw7+ID45d+WPebh3GwsQ7DS3lA99Ev3Tg3BPDATIZv04oW+W+GHzmWIsOMry7JFBEkH/a2hlxD9tfjtwjrpy9TcigMFXnVbbByNq4E5eyL4ivqJxJ0THDznY3I34w22H5oHQd28/Cct1xSqxdDIHfmZaFfOWVbU+oPii5fOa9gVqw/cpN8n3ANh4WzW7OOknWnuE7zN9c1Gm2YyY3A80kyJNvvjhbMvHGEGa2gERuKgLaI1AcZIXRKIPEmWqLJOloVxALpyu4ovrl3fawlK7GLj7ACEUGrafTIdOiJhVvr7KBlRtAAUzDwhOYL8NwCN2rBPIUsQO+sMa2licv+5OPalm/ybnAKCkGihmLmVZJBUZLST3tY7Ax3iMzHrLY5Ipy06nm/0Qry49IYYTWtmvSvE7ZXEN0Pp5m89H+tULke1cENgUciZJQ== 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)(1800799024)(52116014)(376014)(366016)(38350700014);DIR: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j8kzsxd+heRSQ2ho9Mlp3KErgBQ7284CCltXYztLy8yM0FR/5zc3dYsnqfycBxN5cnSm2kVD7J++TUQmpwEW6D8kcXXzDNT823EOhVLBozGZt4eCjZO3ZprTI0HvBMAuPhpjZwiemk8bD/CZ1OzT0njdSHPlB11hdEUrlXGVtPhH8DBW3J4V1zcJeCbAq/989lMUqh7RH4MMPNpWw49fToCnHOMWTj42Yce2KAkGmO+Q1wCJLxvL9mutxJRezzSyLeSd2EY59Bloiltn0vI/YI2rFt9tV+i0NE/2BBVPn0lbtgYoNuS6pvR3KsOgcWYgLwUNeDf7RjkvXwIEjdpZ/+jWTwYEZTNw40QG21ZtRXI1eZsvgvqyfl/TVEh4Q0wsalunqgTma9y0kprzvZcbwHJsSTOBtcSVPuUGmQIwvpl8X1O81E4/09NpIuq3HM/1vhpzRG9x/z/2DmmmQulpADnrtYrE886NMZFTDW8tHn5GuNheyvIqSp9gRezs3MlR/0zQh6RbXw6Lz6dtQPT1hbm6R4er1XJEDIm4UBYxvpYsAyeSNxwrffBe5PDAk5nlq/o/k7owSTXc/5zoG X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d031f72-d463-432c-19d7-08dcc640ccb4 X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4486.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 02:34:39.5989 (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: Bgi8p7KKbjPHZhnMttsAIlOzoFXUmlgQdcz7XDmnbCJpKONSudOS1q8q1BFiDQyAa+7MVOD0tBi8u7N3/590CQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5214 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 Acked-by: Serge Semin --- drivers/bus/bt1-axi.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/bus/bt1-axi.c b/drivers/bus/bt1-axi.c index 4007e7322cf2..a5254c73bf43 100644 --- a/drivers/bus/bt1-axi.c +++ b/drivers/bus/bt1-axi.c @@ -146,33 +146,14 @@ 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; + return 0; } static int bt1_axi_request_irq(struct bt1_axi *axi) From patchwork Tue Aug 27 02:53:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Bo X-Patchwork-Id: 13778745 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2043.outbound.protection.outlook.com [40.107.255.43]) (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 51EF9C8FE; Tue, 27 Aug 2024 02:39:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724726342; cv=fail; b=tI+BgJellN0IBstDs3opj9GmEsMyteNsEcmfk6O/27Rq2iZp/5+NBfmTU7XOZVC9wjqT1uJUvKHuHzxUJ8GMQPdhrDWFCOTLd3sdE50gDVT+yb3qOz/jqZ8EyP7FGhxTXDTtey+UHTHi1gkcSGSv1mZtegg3sb4To4pF58RDjxw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724726342; c=relaxed/simple; bh=2XMdLxLysw7v/oWA3lqRp+Rhihme0+u9FocwGjTiblE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Y4gZGGmHTHUeKoQ41p4P/te3mAf9DhJW9wS9Q3mjDwWKccqV4Gc9rhwGFaZ2lWhlv+/xOHekWvd8JjLuIN3mK5y8bMJSmLRcSsS6i22kPqd/V1PPkPgrxr0RvWqMYn5O51JV0XOTiebNBWwcjUNynaRy07u5rDTghbkBWiITCTo= 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=A4nf3OFy; arc=fail smtp.client-ip=40.107.255.43 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="A4nf3OFy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w8AvDZCvMy6dD3dTZlr4yfpLRoqibe1SO/+imwM5j204SqqE+ea2rAC8+YezsK2WP+ycI2sTxSAyjQT0cbZTOP2yeuaXfp00dCiAzz4n6ayyO+7Zgjx/6uteHlw0iVHrcRccouzfbd+ZXM7dHnFA0WSeHqvMIKl9hcPLqPCXvgF25oU2f2DejQa4i/JhSiXw2YQPv+oycr734DFG3olVtCaMA7CUamhoeLaaSG/RXAhnGvh0wycRjPQeb7ShFIIPvUFrSoQ8kScBAI6CQ/IxPcYLT4+/0U7natZeKSzmWQacJDtGsjB8qMtlWkrD0MRqzokDZyxVqhUEWtAcfnT0CQ== 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=jRddbbpYjf2Obi56bYY2mI2MxgX86TbwYibHAMvVQVU=; b=PEeiW+/eEvqCRqtwomans0ptxl0ZOADY6JFO6tTH9qUybiYa5Cr/XDD1QxEQSCW9fvwJVnLM7KwrvOJ2MotBfo6heBOKk92htZQznK/IYrdQGsVpCXSE7PErpP+o8VYvVsHwJpWhDy0MAdznXeRpngYO8YFep7Ap1o795EtG7v2k8ZVty00kRFZAqM2v4jBz99ruN9zqySGBrMNY2SD9umhGBFi4R2ha+OHIhDq8JgOJXd1TFXU9oBXRPq8ExFSRx57iFMKITGcmyZOGawS5hLzM6IjyepzGwI72X1OSVzj2KRSJcUHMJmQ911zYcxkP67ymFu/RfQWb5dHNUV2KAw== 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=jRddbbpYjf2Obi56bYY2mI2MxgX86TbwYibHAMvVQVU=; b=A4nf3OFyZOa3gn3PIuPn5xehgP1zS82W1P4cBuQH9tiXGNgQ6E3qHkLs4BVlHm9L6YONsoZNXqbiEAjfMlwvjRHZF0FBgyKZGYpGTWt8M3ZyC31V6y9T1KnVGKCsmkdKHWGw/xgzR/5yA3z1Tv/2gAve60Edo4GhN65lx0+AKhJmzRGKNwgRi/NZMP/COQKTFHdt5WfaXmqeGqNxxOCcJmXsCgNw+9BHO7NfwYSoVkhGqJEevW+4tmo9tPFST6nXzutZBST5RyUSh3/TuE4tqFcdLU4qjm2T9o+M+pJMVSRrQBoNOf5b34/B7Lzd9It/aBYHNvMRJIiA8wSIuFMMBA== 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 TYUPR06MB6270.apcprd06.prod.outlook.com (2603:1096:400:346::15) 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 02:38:56 +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; Tue, 27 Aug 2024 02:38:56 +0000 From: Wu Bo To: linux-kernel@vger.kernel.org Cc: fancer.lancer@gmail.com, linux-mips@vger.kernel.org, wubo.oduw@gmail.com, Wu Bo Subject: [PATCH v2 2/2] bus: bt1-apb: change to use devm_clk_get_enabled() helper Date: Mon, 26 Aug 2024 20:53:58 -0600 Message-Id: <2059e872cc9cb129752c1656be073b1a6beb4cc5.1724726725.git.bo.wu@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <98e5fe3c7762f3c2cbf7b2f3b3461c0cef789dd6.1724726725.git.bo.wu@vivo.com> References: <98e5fe3c7762f3c2cbf7b2f3b3461c0cef789dd6.1724726725.git.bo.wu@vivo.com> X-ClientProxiedBy: SG2PR01CA0119.apcprd01.prod.exchangelabs.com (2603:1096:4:40::23) 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_|TYUPR06MB6270:EE_ X-MS-Office365-Filtering-Correlation-Id: fe7e5e74-063c-495c-af9a-08dcc641658d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: D+/NHLlPcV4wE3C6VSip1QO/ERtpm7R7661KTVS6U7pLG94O8WDGsHccHruN5dkdaZgR+odabhUm4SDpHsTJGxm7hqHsJEJHENLjAaUCL24IzN+PhFCVwvySQcYKUE4MXblXRWL1C2VBNL1mnwPLsYcR87oxnPd7V3WpofSCcCpIWO10cCd+Esywhl4Sx7ZIA+TTIuOfhBJqqJL9DGQMuh3cBx3Oz5oZPCaja0liIt97yTp07LWdv2h5AKP+VvC7ko6hQBR0N4PBgWW7dBzxSl/tKFuZ/5s9qc15zeMIKY5wXhRTzig7fwqWH9YL6lDXONiJk5Rc5eUOGKz4nL14E/w6iJAyVtAxHumpeY3Qr2jCSWe0Ip6e7EoaDLesUyOxBzppVpaY5uhnimo+0eo7P3wu4t4E5+5R9zYUfvpPDtavAqwq7dQrSFNHsId3/aF7hAGWHpa/YtCt5XKbE0UwqUgOR9RJBxeOLDenc1o908sBaPiyvntr5WT2kEP4Nr5QHmxroqTfOqCGW/IR1ycR2bBrttKX9B5LjAmFCJOyZxApN/le6QgBi403g8wWzcRpm/sV0aEN2tmen5O1sWAQ2dISGHTNNKp7Nbmp7UanChLSwUBBE/y0Cmzu9hiG9vLPhzSrSrEdxsLdRwb806r/D4GLflS7xCkZFwzmejbD7INmh1eje3KbhQjLDNz+0vGbbWZJvozQu/QA/GhUwu6oybKTo+XNbrFaaoTviTq/ZBcBty4umsifZUa0O404OkK+qRYX+9jNMzdSqNt4etzjpPfY8QsPfxXL08ggLy9V2CPrNDvRySiX3zdiDHtzqVJ5K2Z81fcuhgXhFGzh2Hjq82GalZcSK0HWknm6UInPLVdM7r0vN9Nkit4uUsM9Ae4w6fREXIJlc+ZwDCgtLVbCIY0P8NL6WRWh1v8ccmQVX6+TZohKgKdyN/EzYmqyelYk0LoQl2hGxR/ahlAHRtOXFyajgC5+oofSjVTxKSWwItsun6p3vGSMXS5L0efwwBTwIdIlZRFY45d18rEGwT5L9cLxZDZnl6tPHwHEWB4G1z8zWEmAe1+0ouA3+1GTM8fMU1OGfnwuO79R+c2ysVdnEjvJHh311cfe1I2nCtlzcd5L/OEviS7hxp6PEuWW5ZeBRgkt7GLtMrqaSrqjTQKYAEqSvruUDamPzYH52pq/QwiLgWEWknO/XXCvAnf3h1rxUYqKdWDKPPX6iiyI3s4N3a9nuzSte9uEu3fXR+N9qoEwcNBKt0gfsZIsRaQaFw/hGKGEspDJfbJR+A45EDsJBOnqlWndUrbHFoQN2NFiPAGwVmOlQYK3GgAgaTaqSX235gi0OLqXWmZ1AaXF0UuO+rvwLKTU6F3hSwyo/WmdyxSrmQLKD817krxRm/AbkSHVXmdu3I/y020oxDvyZgbrwQ== 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)(366016)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CdZVd7hNU7lzHnXyudM1HxbKG7vkkmdDmVIfSsyR6NILBoUeJ1+AOJM6IEhNMBFrzgGaGRrcSOViUxOAs15uQsjiwM1TM+rhPngv6ocUcaxaUn7cZL2+ae+8Ip2wFte4KhQ3ugQYV+zAd8Dj4JUCyv6XxKThjkq/0pzl3IE9lQZU5r88NYBgjsXemyrIhdZSLG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MhKg7hQGTzUlFsBHA4FYr+ZQRomvEE25DIRp/Hld+sQurNhYn0r/Cw/v6shP93NLphoGKlR2KSSIukbZL4f11mw+0VV3UtDH/dkWqikepOaWwmWS4EsK+lf3dj5sE/k7GflIZxDuWUmVls5hcWXWJqNprw+LCmbDteTEjD9Ddroy0mGwX8gGKVZL/vTg8YaoN2pEpwlMlfF5U2Md9MrgnJHIPDfyVCsdwPknkp7Im1Q8XkTBJA/Fhk7j5e/U/gJsVajFUqLg2rIzmj8SNhNVcIn8OdHCOv8NROHyfCBxPlEXI2WpM6rTqBwNgpGrpLNVC1RJ3PvD0NT/eEYw3xsRmSxz X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe7e5e74-063c-495c-af9a-08dcc641658d X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4486.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 02:38:56.0663 (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: KyzskF/x2i7s2jDBKiM4n+3MpZ3YIdkelRcNhhYnxGdL0a32BXP39mh2LWVE3ZPBr+6o8inE/IV/xhOUEf5ryA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR06MB6270 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 Acked-by: Serge Semin --- drivers/bus/bt1-apb.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/bus/bt1-apb.c b/drivers/bus/bt1-apb.c index 595fb22b73e0..7463124b6dd9 100644 --- a/drivers/bus/bt1-apb.c +++ b/drivers/bus/bt1-apb.c @@ -185,34 +185,13 @@ static int bt1_apb_request_rst(struct bt1_apb *apb) return ret; } -static void bt1_apb_disable_clk(void *data) -{ - struct bt1_apb *apb = data; - - clk_disable_unprepare(apb->pclk); -} - static int bt1_apb_request_clk(struct bt1_apb *apb) { - int ret; - - apb->pclk = devm_clk_get(apb->dev, "pclk"); + apb->pclk = devm_clk_get_enabled(apb->dev, "pclk"); if (IS_ERR(apb->pclk)) return dev_err_probe(apb->dev, PTR_ERR(apb->pclk), "Couldn't get APB clock descriptor\n"); - ret = clk_prepare_enable(apb->pclk); - if (ret) { - dev_err(apb->dev, "Couldn't enable the APB clock\n"); - return ret; - } - - ret = devm_add_action_or_reset(apb->dev, bt1_apb_disable_clk, apb); - if (ret) { - dev_err(apb->dev, "Can't add APB EHB clocks disable action\n"); - return ret; - } - apb->rate = clk_get_rate(apb->pclk); if (!apb->rate) { dev_err(apb->dev, "Invalid clock rate\n");