From patchwork Tue Aug 27 07:48:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangxirui X-Patchwork-Id: 823379 Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010062.outbound.protection.outlook.com [52.101.128.62]) (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 56C6A12F5B1; Tue, 27 Aug 2024 07:34:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744082; cv=fail; b=u6I6W25q66myJAbeSg28mG2VJ28zs4ccuI4zHEi0e/FajJV9tvZBHnAJFt8IpVh13ZQuakN00MNI2TqmEoYKWXcu8Bxi2CcapDrAXXAXJzaB/3Tsz+Q2AYVA53FobdGFmUWUE0LJEuXy687zQCArCacCGhP9ko/EOeDo5Tw2bgA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744082; c=relaxed/simple; bh=ABNQRMf2fGB6XHFS+RF2yaQMt9Bn7xQMBpilQu09+jk=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=s0gBw7ObvZrYrRUgvevoDDArroejvNWJ5dGGQlx4MYMhKyOzsz9rPtiXP79zv3IednJU+xx9hiPe1apyRpiRTQAwQKmNipnTPmK4m4Mmxww5fH2BtrdqB5A42AUigNtqVpO9eEx151qOkX9n+yYUHY6x+3OLtwoPXfbeDcqUteo= 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=GfKWJl/I; arc=fail smtp.client-ip=52.101.128.62 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="GfKWJl/I" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xJw7rsEP6+fGIAeD9gb9PdcDuGg5cMhuurVN65R/n/8xi+y7Nbv5o+LU0wsaG1MXa1m1Kjo4kSrrMcYrH3dViqrzwgnM190CoC1qWNvs+S+rnPBJVQA/gKxWvnODgiRZRr2yDeNNd4dTK5N91AvwAkvP0xSFiF5cu6u43SQwHzpz8oXSFbmc2Cu/sVKBPv0jqjSA1bdJmY2eHwBg2LbHtBAYfKPnGz9UE1g7IjHZc4AG1keNBk2nIBPINFdVmByqziaCQIHu8gLuEIc4PjR+ZttCn5vH1aXB0RLY0Sl3PfwGV/A3Rod/uRZ3cSFhwzVfho/GkFkSE+bO3FvdMhnkBw== 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=posYKQbWWTEJWc9YhLSbmjzO2EaiJH/gcEE/yOXaY8k=; b=M8N1JH/Vs/eUkPFu/ei0TzhkXsd1wnvseYZbRZ3lk9vKTU3i1rAcAZvNquSuUS4IgDgOma3piqVIU6Fzs13AfYnt/2zA+++jegOHNOdLZYG6tfe8/0l8Ao1gBrRhHt07kPoa8qQcu8nMYCLczEM1v3gs92FECukJOytnfZu1w3tcc1EEqY/SjK2jmgmJy7bvckKvhhfvnE7HVu2JESObAiSVwIFZpydvXJSRYEOVtOZ3CBhx4c/gNn+M8IN7A5/3tafd1tabKZXUe2e3Eg9FBmn3W/+cKebi0f3jMdEggnizCy7jkNbmFXeA4UBI57EVXRS97r6kXl6pSrIMzKKoFQ== 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=posYKQbWWTEJWc9YhLSbmjzO2EaiJH/gcEE/yOXaY8k=; b=GfKWJl/IXxJBOC2Sgftc/zk1rDmhiQXdLQKcYd+iCsjD6MWcXZB7+bCq/VpSkRyRRN8At+wup920ZsnlpTFpTR0ZkvElO6K9KzDYAOLKtu/vWRbq8qXjoXHrlxhvasU8nUi6u3ljMk1yY8pQnmnk8Cz3E+Ge3DsmcqazQXNKwadEZkr5o70U2KbXEB03GG/9tXnM40fWlBzSS8WfNNE+ZhI/L1g3dsMxPUU8syfe5+LqhOGl81Ujuw42S9bCVRM5KZOMxaS3LvrPI7dfJvLwMFTAjUS65dz4Oa+wvSfrdcxqhOFamkSZ3MFXFZmafEnacm+NCa9y/nRNTPWXaiSpJg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) by SI6PR06MB7102.apcprd06.prod.outlook.com (2603:1096:4:244::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 07:34:38 +0000 Received: from TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318]) by TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318%4]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 07:34:38 +0000 From: zhangxirui To: Robert Richter , Ulf Hansson , Jaehoon Chung , Nicolas Pitre , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Adrian Hunter , Taichi Sugaya , Takao Orito , Michal Simek , zhangxirui , Bastien Curutchet , Linus Walleij , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Bartosz Golaszewski , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/9] mmc: cavium-thunderx: Use devm_clk_get_enabled() helpers Date: Tue, 27 Aug 2024 01:48:39 -0600 Message-Id: <20240827074857.2671808-2-xirui.zhang@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827074857.2671808-1-xirui.zhang@vivo.com> References: <20240827074857.2671808-1-xirui.zhang@vivo.com> X-ClientProxiedBy: SG2PR02CA0005.apcprd02.prod.outlook.com (2603:1096:3:17::17) To TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5178:EE_|SI6PR06MB7102:EE_ X-MS-Office365-Filtering-Correlation-Id: db6fe64f-abcd-4aa0-1ab5-08dcc66ab4c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014|43062017; X-Microsoft-Antispam-Message-Info: hvoZwisLN6LEyZQcp0FCoU+BjFdM7Vm1FCfat7BF5bn3d+wdbIxtAe5g8pMq98YOwEn3IgBOr4YK69VIkKqIaaTsTlz8vtXEa/PkOgAIVUek4to/TnYVjGTP3z9kqLZVCEsa4u0aWaJ7TdzAmy6VH/1rOMEgGuPG3MyqyNmClC4boUqaGVQSQ+GlWU/J5gKuXDdPyUMvNQiAXr8bFFsRIMLU6SMbVkROQcuXXCuCraahJKFIQo17j6h7hPU9cK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vaa6/6T4AJ3X49gt9dICYjGKzjYBpK38MqYAhy2Wn75VBr4iCjb/TAsdilfYYnjbxuwohSkvQqM8GWdC5ehP67B8sMvA3+3nWCn6sVUa/aSMW6dR94c0X9x7xjBIlLNyAmKjS6bg8jB X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB5178.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014)(43062017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0uhIYZQmrjmAyUpQp4EQqFngCP3R6nRO3EnsVhQsNG8j/nL/jJTIawSuEQxipmDLmqB554+nhxpyeXVy/5w6Jt74+RziaW5J8xHsnVAJvkjaQHvfPkrblKIioDmxHdeiQFsAddtaU4SoDjXjZE8e6lkp9DD3bgw8h2poSawF78XlJq4OZLXYpbnMZ466HycRU0PwaiWvbNxo8GzgwEELEg9SU58rYRv2502BBIdcYT/npNDvYFxnYXwXmbehEfrb3VgztZYra/f3KUuHSZ7OYPL/cVAre/awtvGRj5piycZRrPR/wkLVwkeiukvnn4QIb6zSLuEWb5Ley/bCusVEuY7v8A9AyvOonzEelNILfXe1yDJ2AqKobuuljY6jczdBia0KdPzYAxQ1g3ZLUkqbH5SROqv5LqE0Hhfn2wG+7txUWfQb769zfhhB+vw+CU2Pl7nDtlnQ2+fBLTzQJj7DdSYhNC7tIqI2gQ5czF6jIOV3WV1LUzWDMrddv3DmAynf+jp/s2/wrREtrhDkFn08Uck4qjpaw8qvb2NjL8TOVdc/OP+Kp1PkerScn6Mobg98CwDqJVLa3aSN9Fwyh9sLbxXO9cZ1qD697N88NNA4G52WbvDA0y7HsT4EsL8Ks6f7MM0qOrxXgDGWrNA1iv9wVspSU9IKHZS5m29o1jKYNneFSAOg4xgk8F6sghrcCL5ssJ9ubR34h4hEgcO0dxH6Rso+Mmx5LDAyuZ5nFUk6yZzEUSXzE2cnVTt9mhMvzo+SzEuWKa5/zb+9hOfNRNmhMx5T1MjxTVpB6gp5LK7H5ufSQLULKlkS/uUZdfE21O3k+tQ5SAqPfNsLVF96+cCB2sEZs244dspF5AczNO9951ch2wa3rkCfgyDlv5yiFLxDwppCsZCR0eQFJCD4cL9su0xUq5xz9tMHULeH/mmGQA+P9z+gLNengEgWx4KcSW6c+Z2jsvQocjn5d5XFUmjCi0S3YeanCLqaRpTSrjs6VqGaoC4/H6Y9+KFBkyo52/IvatFkCf6TKEamfISthcMa/gtjQTMtrcfxCpuBmRxkTstehkNigdJdAwsZTV3VyMkV1BhgVfEHfm/koFuY3W/iIzF+hf6RNAiqex9GFKhb3nz+hDa4NIkv1U9IzsibozHz+41TP9JAEOwhYTxpl4CSMvkCa5xGWIt1Sw8TqEVNG9TWbFtRGs9Zc+T/okZBefVgT777LEu9VYd+6ljguaWm9YMGKH4AFG05rnJ3eRQZ96BJ5oPAkgvxX7R/d1oJdWdNL8SHdIbc2q7s+HxnFDcMuDMiUKRPrj/ij3N5TIiQKRRhba5QJV7Ob4zjp4LWmibDuF6cuay4ciXQoUAYX5aoCJk588DzWKyVxNW9riQCe/Mwl0Sn4QBlUdt7NdiXQNjzzC0S9G9klr7UXE9OhPJ46y5ZJoiLt5nsAFNS+xdrnSXFn403nujVm6IXarYiwr3VZGPu8jT/VXJ+eW7QcNCcmxiGfavFdJTAsmnXSZx5gXVgnGWV/DkhbirYbmW7JKBIIkOcvWOd8p67pKk69yVCfVD2Yw/syK3aSg8l2s+EjzoPMxJJKRZjO1u5y0GgxZh9 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: db6fe64f-abcd-4aa0-1ab5-08dcc66ab4c5 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5178.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 07:34:38.3230 (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: k5uHeLLH5B6dJX9KL2isJTSSs4tdZP/E+Fs+L0lhnaGKbE/NwJhdRB7NXdBIWxiU50jh8RQBGqlWgFsB+3KQGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI6PR06MB7102 Use devm_clk_get_enabled() to simplify code and avoids the calls to clk_disable_unprepare(). Signed-off-by: zhangxirui --- drivers/mmc/host/cavium-thunderx.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/mmc/host/cavium-thunderx.c b/drivers/mmc/host/cavium-thunderx.c index 2e2ff984f0b3..8111e24c52b5 100644 --- a/drivers/mmc/host/cavium-thunderx.c +++ b/drivers/mmc/host/cavium-thunderx.c @@ -88,15 +88,12 @@ static int thunder_mmc_probe(struct pci_dev *pdev, host->reg_off = 0x2000; host->reg_off_dma = 0x160; - host->clk = devm_clk_get(dev, NULL); + host->clk = devm_clk_get_enabled(dev, NULL); if (IS_ERR(host->clk)) { ret = PTR_ERR(host->clk); goto error; } - ret = clk_prepare_enable(host->clk); - if (ret) - goto error; host->sys_freq = clk_get_rate(host->clk); spin_lock_init(&host->irq_handler_lock); @@ -163,7 +160,6 @@ static int thunder_mmc_probe(struct pci_dev *pdev, put_device(&host->slot_pdev[i]->dev); } } - clk_disable_unprepare(host->clk); pci_release_regions(pdev); return ret; } @@ -182,7 +178,6 @@ static void thunder_mmc_remove(struct pci_dev *pdev) dma_cfg &= ~MIO_EMM_DMA_CFG_EN; writeq(dma_cfg, host->dma_base + MIO_EMM_DMA_CFG(host)); - clk_disable_unprepare(host->clk); pci_release_regions(pdev); } From patchwork Tue Aug 27 07:48:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangxirui X-Patchwork-Id: 822978 Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010027.outbound.protection.outlook.com [52.101.128.27]) (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 47D3112F5B1; Tue, 27 Aug 2024 07:34:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.27 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744095; cv=fail; b=XwdDS/RAXnI47egcViLZYCI4MWI8qPV1Hhwce1hW3ADRFyWGd1Qs6bKvtwUI6h5PXDAJPcAdKop+03ACk2vXqsECh1dGJDBWsjpjFcd+Vixgf+TY756Sp2exmEKsWzSjwNoYjc9MTdEAQLC8JRm4nbTt/potxFckHHkkq33RFPI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744095; c=relaxed/simple; bh=CatR6yJF9yjGW1nbrhW0FHlxdYQQzsIJNzpjHb5uN1Q=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=qGuhxV5SYJF8y02hT/vgTvBIrxy1XLTY/sAG7UbQtzCqJVBzFTJz7sZUChzEswPNVS4VwMxQZ0lyxXSRZfLEpj3jwaYjF3afo9r9G/5AUwF1Gr9c6wDCgSVcYAEbSvDwP8zP0xteElw7D/egPgGMUdej5naUaXzHRH+dhvw5zTk= 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=XRoO7kWK; arc=fail smtp.client-ip=52.101.128.27 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="XRoO7kWK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HoATgHY9IIsrqQlzqUWFnIk9khyVTf4UgH9xkXqg/aJYhokL4K1+QeTkCXXNtmsM9K2cyUCENnGKfzWFyhc2OobswRFFem5fZ/AvG6oAClzKok9q9KVycWeovS0W3YI+o0X/hb/9xOHg044zDfhfQt39uRr1oXkqNzlXXOBzSvYcYnnRExv+t6yEC15vAyG4nNCgWSBA5enaKJmy+MzVBlQp03ZfJj2ynivuv5ZxorOpcEdEXfwSzuxE1I8SfIWx6pcQsJNLpbEac2Icmv2zWFTEO6uvm/IdTc2sKO1VGR2tGNbj0NDrvaKxkRHQvs67n8m1DtKDW27JWPfNEpQOmQ== 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=VQ+XYxeMXRYeovd4iwShM7nU+RCgLZqQthYnaofweqc=; b=Z2and/EA5oOLTUmVQfgiZv8e3lGplQdeaeLCP9VLbIQiJcp/GKPrmH1JYQCMLcKHMjNcUy4l5FlZdtvdVbhqy4JtmU/Iz6e2WwDJhhoIHluWsvjZ+GTg8QG7hsVSz/WF8qUjSFGBxJeWL5srBvn8K7kd3N/fTP0QdyWmtGO95ih2RROS/UyOcK5S4s0QY6YAt88cscgxa2QlCH3MRCVzi87sTrkRNEU/Xgu4nx85G92fGSgj4cKjEpReqAAwN2u3q+oZL57x6iKY4VJt2lvg4mb3Ug3ImO4tU5GsRiV8AH53hL/fYkSOjTDVMz5H6NtIX4uJMV7Dd9qoC7SuXlVQNg== 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=VQ+XYxeMXRYeovd4iwShM7nU+RCgLZqQthYnaofweqc=; b=XRoO7kWKVeYnbOW70GDlUNOzbCPqEn9l0I/dgN3CN1bww2Zn9LZoVrqevU5exzbPESI80KCPWd1BPi91E19iYYaCAS4bJzqLI4ZjDkYvr8aYCYlI1w+dH9G9sT+dUHUKBxoeLvod0iOest1U0JO2M57b6SFlwA+47XBlzGhDS58y/2B5WfMUxmdFPyC01a15FEKVKJ1fbbcDALkDIVTu+lb75RGYc2ycMxbTtXMpdD8KXrGg/Wgc8oTrAA+e+DU4jBFGIzkp9r4/9fgHHRqTYM0HLiKfdRjPV5H89iUDyB8/hu2GBQSz8TgDacdqfkVFWqxLw0KHdSPUKQfxs9skog== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) by SI6PR06MB7102.apcprd06.prod.outlook.com (2603:1096:4:244::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 07:34:51 +0000 Received: from TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318]) by TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318%4]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 07:34:51 +0000 From: zhangxirui To: Robert Richter , Ulf Hansson , Jaehoon Chung , Nicolas Pitre , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Adrian Hunter , Taichi Sugaya , Takao Orito , Michal Simek , zhangxirui , Bastien Curutchet , Linus Walleij , Bartosz Golaszewski , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/9] mmc: davinci_mmc: Use devm_clk_get_enabled() helpers Date: Tue, 27 Aug 2024 01:48:40 -0600 Message-Id: <20240827074857.2671808-3-xirui.zhang@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827074857.2671808-1-xirui.zhang@vivo.com> References: <20240827074857.2671808-1-xirui.zhang@vivo.com> X-ClientProxiedBy: SG2PR02CA0005.apcprd02.prod.outlook.com (2603:1096:3:17::17) To TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5178:EE_|SI6PR06MB7102:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a58f75a-721a-4176-9bd2-08dcc66abc8a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014|43062017; X-Microsoft-Antispam-Message-Info: SqApWg+fTfXseJ9szGQgk2iLgaT8wVoOaJj5a2j2XMyvubCX0YPWK0IslnvOs/LmUKBJeeGZ9DBpQypsr/fxGg2Q1x2k9ZcrdjKyyAy5p7cVoeYNg82I6loI3i3IHf7uOZFpxT6VCLmzvbpNXWOsQ4ShVq8TmY4m7mo4T4jsCDou1T31RnBE15l9fOygdBG52aLQsRuz6xHI1/ju9vizB5K3QxWJvIeL9vEIgl3DPX4mMHY6F4zvYmCWlK2VdraAlGBQqnmM6WDjWCG4jXLPsi69V5Whf571PgIECpOeyFzv3IG98xitQwR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zSg03YEWIuS9qO2BwR78PglJ+RJseCAVq/x4RjMvDX0CXj3fpZErfQ0eQ1z6gAy6opOEafFh57+nA/7SPtkl X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB5178.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014)(43062017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nmbKQYW+Vn7EndXQD0zXb/NAqKJvvmgLtB77JsEjuTU6Bk/rdt5PfQLtar7Ul7r0mDed9kuIjQfeE1EOmr3U9o8EU2DLMClIQ/JGlZwFve+6MuDApgdrfbB7pNdouD/xxFxkO9zkrxSw5TRg92wGWfSFpmQppqSZcLeTPDRXQk6aoaC5nR9AtgsOMm+U30f/Qe0TLKrhU1iJyiKoFiLfUnfdjWO7hUAQJIxewjRwxGwwChCpYYmNtZLrupmPu2HJsLoCEarr3wQ4OSyh20CcmDYsb+AvE4DUnqy0IksZ+L2EL/xgsVK/Fx2auBlDCIg63zDtvEQ325Bv1/5z99DVfKxJ9ewpMTK6Tg1s0fNi9DZvSWu8eyHS22+ze4s+YPC4alcqeVxX7LU1IuvhMoLmrLlyBhGrj/brOKjynwdxccSplfXlmaI8XQD4YEPR3Au74IChBURi0fLqi4R664hyKdASmV9JjBE6PmTxu9kKJ36htFijzQWbJ+GHXGEGqXr8iWTqdyTN41yGz/fwb5V2HmymFZpQuPxejQUkN7tbKz3aOkZPjKdVEtFu9TlGVYwvfNtW7EAmbkoa3poHwkHXQxErfvOqTu5t1vTFYN/2xRxSzXepV+4SUfPaqb3ed01KKgAhFOIu4nURzUap/Eh+Rp2l2ST0+Zb9u/hZgBiOACROx00G8VEGoFOq3Nf5cPVvB7GTmxLZWVNv65FiUn4vUm/3ouljZPogMAqjJ2LloCySo9AP/Wx/xUaukP2u6mcRXATkAbZOxYQX8EM2wMUBLEUmHNtsONZLU+2wZehNZcAYQ6UX4+0UbE5pA9fhYF+1AnrLN1SSZZOKdYa3zaTCPPzDUmFKEgOFJZiMtgYFi/bv7qcnevPxOHKW/eq/b/VMZG3oeCtP+Oa5FZw9pEY2L2U4HpfdkV0+jAEtMdznVd8YaKvcgy5lqvcy5Z+eUyZx1+qnJIt+9P8IZ0IZ6d7jD3Aqv8psPp0bJk4azyEn+LOz7rGJ/Aj5NZYGVNb6bM9ME/aaAcceXmeew+mnnDdv1+LrwX2c63Hps2xfRwvqJZxfudlfLJitPiolIJgKyzWoyNasa3xkMCO5tVHkfunZ23zDtAEJOEI7QodQbRgVcGUmujQ0J8Tz7EHqWufK6VZ6oxoVGmByJKBdIzFYAOmPytVklNzkz8sLYQG/kNWR13kO48wRdJ833fwGJoXXqW0DjK8kHD1Dxq6UGu1hvhz/ygnS3VYE4HCvWZ94AeQkaeEC2vDuwDd5X/JEd2wCraJH3kpPkdprHvcDHsIWpK4ftsKGVwzF4PbzFzgEtnbtGJNDR8dM48fVosd6hdifhDgO9E0oBcPdWFYxmA16no2Sa+MI9cWn1+G41+bJdKLPccT2ayNloP2RZ5hpn2yogRQKoO/gN/R00pdHct44x4QB1TKgB3B4q96Qt4jNP/dPUMlhvnGJMj0kVbKExseo1nfXEy0HSZEYc09o+s7F4eIUqQg8RRNrAQwcJrLV36OVE9DQMbF3jNXgCcceVgJ1vOJyW5KeDWlQozUaqHnZZDOV+joabs2cGo6qh2Oa/CY5u05Ryf4sLkzfXIbQVUnaqw7s X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a58f75a-721a-4176-9bd2-08dcc66abc8a X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5178.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 07:34:51.2993 (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: eyHwD8Z5V5pzbNFA41IKGNOW0Fyc63Z61WMutMPqufpTfIebptYcKzEP2DJw+EdYCp/0UASczJMFTET79wnmGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI6PR06MB7102 Use devm_clk_get_enabled() to simplify code and avoids the calls to clk_disable_unprepare(). Signed-off-by: zhangxirui --- drivers/mmc/host/davinci_mmc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index 9cbde800685d..3e71565285c3 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c @@ -1218,14 +1218,11 @@ static int davinci_mmcsd_probe(struct platform_device *pdev) goto ioremap_fail; } - host->clk = devm_clk_get(&pdev->dev, NULL); + host->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(host->clk)) { ret = PTR_ERR(host->clk); goto clk_get_fail; } - ret = clk_prepare_enable(host->clk); - if (ret) - goto clk_prepare_enable_fail; host->mmc_input_clk = clk_get_rate(host->clk); @@ -1336,8 +1333,6 @@ static int davinci_mmcsd_probe(struct platform_device *pdev) davinci_release_dma_channels(host); parse_fail: dma_probe_defer: - clk_disable_unprepare(host->clk); -clk_prepare_enable_fail: clk_get_fail: ioremap_fail: mmc_free_host(mmc); @@ -1352,7 +1347,6 @@ static void davinci_mmcsd_remove(struct platform_device *pdev) mmc_remove_host(host->mmc); mmc_davinci_cpufreq_deregister(host); davinci_release_dma_channels(host); - clk_disable_unprepare(host->clk); mmc_free_host(host->mmc); } From patchwork Tue Aug 27 07:48:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangxirui X-Patchwork-Id: 823378 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 7DAA117BEC1; Tue, 27 Aug 2024 07:35:07 +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=1724744109; cv=fail; b=S6JmHxjMSkZItdP6NsqBpbSvfXMdnj/YteFk2zAz6gyxVoPn8HDHQdt5D9gKyYzZsYoYsrod6lzXNpYloOROK3nUSbSbCAjqZPYiKT3vqRaZaNoZ7yT7wEQCeJkyiCokfxxewycLFD5PmlwxAn6bUHa5TrOnk/+rS9L8SEUci/w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744109; c=relaxed/simple; bh=HLmb+oWGzAToN/fOb4UKksZbmTEmxx7VMMCA6v9zkZ8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=W6ye0TXKhCAFURZiA+Bzfh6CCNWexJwlq6spPVr+HXj6tp9jcML7hmeMZvPYVCeRkt3y+d/PqWuq6//3OHJj/pK93lawIx0XDAkBlU8ndnvf+gbeZFnYcnhGBPrjQGLkr/XbE5yAiET99SNTso0rw9CoStF57Qju4Exllh9ZzCY= 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=d0lRWB9Q; 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="d0lRWB9Q" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cHIsvLJrEns7U9OnoQ2wPChroo0ButKY3pgxvE665Oa/5i+vl2O9YLXAyJhggdiyCEk33+t3SVCIebPtGGe4VPeixq2csKMi/lSv7FYksKfwzYk5lANqYLdoNIFbucT0KcuvZHeC18lYrmCmGD0ctagP876utj32+g6B5sta9wR7DVYhfXgJc8/XYVAUuUoUwg6xi5zUKstE5yTPSTIiVawGyTaNU8RkFg9j9QXpxpl0m2UozmphS7JHzn0QdqTOWNkhKDSe0LbqzEcqLftGbO+YwNccgosPFZK8gu7usdXfJ94bK4mXdr2ZHJG4/C64ncwKP3p6tn85tO8NWzXhSQ== 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=sFNVBON9I5bH62fajLq5bTq3GknanUgV1wKqc6u83As=; b=Cri3nXnVnDzAr2qB7SMKoVOT3SV5bhxWhnmn2bYbuEu1CQTB5Idjci29HuBA4E/bB/oH6A9r91qHCVUZ97VumoDkUHVN2kuydhDCd/ubh8BqDt3LkwPjRqdlfRrdf+pVzzIIjK7haVPn0AAhUl83wMrLEMFqaqN66H59JIQoG858VUPEagspVclbiu3Vi+FO7kGk8McYotXjPdrvQV1HXId/7lyPtpF4q9/DySyUt079fWDjczsPQrgTbjcOO6vYt2SVHybAZsNULUsibvDMuILsINa13rTIXynxUaNBC2SEOnEf5aRyT78veMFVsBpOyZWYfy5uT8JOjH9AUPYp2A== 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=sFNVBON9I5bH62fajLq5bTq3GknanUgV1wKqc6u83As=; b=d0lRWB9QR75hYmwYccaxR0oEvj7o2F7pGUezsgqCLsZ5welnaBmHitSuY0kBePFZd2GTal7MuAVP4BNL5+ViSCzy/6/OghQ7inWZp452W09mZQBdAOPatLkm8IiWOSvm26ZNPGNfVtBuQdziytm8Nx8Oa5+ZvToVTFvdwWUoSOlWztB8jal03akq/XDjzu/ROPCJ/reBvhEjAkIebeO5f1LmR40kt9fk0n/R48y7GZDI+h0vI/lyZo70tQqwLciZIXnCwydGMsI1llDIyEu4GroHVEMOziESOdDJsKpTacugMUZN4JxNWntz5m47YnjsmVNqVuq1eh02kX3cnDkfcg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) by SI6PR06MB7102.apcprd06.prod.outlook.com (2603:1096:4:244::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 07:35:04 +0000 Received: from TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318]) by TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318%4]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 07:35:04 +0000 From: zhangxirui To: Robert Richter , Ulf Hansson , Jaehoon Chung , Nicolas Pitre , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Adrian Hunter , Taichi Sugaya , Takao Orito , Michal Simek , zhangxirui , Bastien Curutchet , Linus Walleij , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/9] mmc: dw_mmc-hi3798cv200: Use devm_clk_get_enabled() helpers Date: Tue, 27 Aug 2024 01:48:41 -0600 Message-Id: <20240827074857.2671808-4-xirui.zhang@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827074857.2671808-1-xirui.zhang@vivo.com> References: <20240827074857.2671808-1-xirui.zhang@vivo.com> X-ClientProxiedBy: SG2PR02CA0005.apcprd02.prod.outlook.com (2603:1096:3:17::17) To TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5178:EE_|SI6PR06MB7102:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c8b4e6a-366a-48ad-3ba8-08dcc66ac43a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014|43062017; X-Microsoft-Antispam-Message-Info: xYj42Nex7njvRC5TgMa5+e1/+RQkrReOZ5ctA1xJjicwiiu2v3OrmEq8U7XMU/C4j3QS0rdzGBxO0P34x7Tnq3qW4e6P+GU1ie8gOri/5Zcr0x40KSD3Rra7r2ErcmUn0jq019G8rFeSo8kve9e0UXlqiT0bqY2YHbkRSc+tZyYkBq2SXHRC+G7zOGV1Dnn4hxfPuUnB41XFv8nzTVDXGkjxOctNtoGtvQW2Ho4rXEcAdXQP+vPTWK5DyOPaB8wlod643asdpqY4lJ2YoY384vrVgC1RjsXRSSxu4FJUJWXszZhiTj2LF6fGlRzhPpueMYsIst79FrafDLNFmXi+PJoqb6w8E/L9m9JH3/ar+5nMsUAH02/SlCb6m2lvg7gCjmSAQ9YZhcWDEFzXDnfp0jZUBHbdsecz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.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB5178.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014)(43062017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WZZ7lHH/9M/QAbKRvLqcE2ODYbVjIyFemiugehf9A+CcPzty2Bte2ZMS6fpcGqETNL41lRkmr3GUQgSuwjtL0rbRuGKVgJ//7cFz1ehXs292zCk0hBAqykCnYxWNEtm1j/IYji61t9KqIKeEgpK7m0jDLgQCr++pVo5Z/VC3zixPpDuPsrjUKwiEjNiP3ppiIQvYB2XqOVz78jNHWboJI54vL9Lp5y0KHUafZZ6K/w+cSY+GQpTf5u+cO7ki7cgTOKM5ryEUg0P1v/Ltf1Z73mCSU3RyP8iBJVtBCsONhwfnt3eB/bBIgSmPihKTLSqoL6GiMv5lG6Zp0dQBQNimkOcdTzW31EBWdh+W2TMugkawlhiSHDzY0Gp0gVaoPZO5kSyQQCtSm37cy5ru61IRSooS9dlO4cjBTTTvgxfWKGri5KjLKkw7+JWL69XWqrOEjBjKwlpLRvaifI9HOR9S5Ebw18UBGDr0pbgGCC8A20zvFePZyNMrD0c1PByRQ06p+R025rjXbFiFszNLMiweHCRkevAwukFUPtxXaf5cYmkpZZ6cYOKmRTQix9G4VsRimOH5s+K5AzF2WNxttheUAPtkpIfsRb1c9P90KHMC49YYphXDg44ICGm1LMHLHXWz6RJMLwrVdn0ifySBVR1I1et8pJeEYppKEIG5bMiNMDNMEFTrvtsv8JqnScfgEDgDo6lCXkzrS0yNbuiY40UalLKmLziL2rUNTPr27LSZ6+5ZGsOddTkuho3m7nR17nP5T5r/2dEC0dwwYwGZ0GAhuDmgnN2EOiG9qNqn+KcWX1a6Yzxih0+5xyJJWyoNGY+1sxqVueN6bcDhBdTsVmqxFVIltDElYdF0fQO8WNr3eFRctzNN4A91bR+mrCImthXJbY6HkF5D/DDq0T8tKhvvfPwzE/OQxsSgTeDJu1FNH2e2oSntaS0nQamaOJIxf11o9r5/GvhWaWfmpjkDsZipX3dag3WAKOZIw7H0fIFKdHWSTMwJYLrHr4eNZc32+jThPxjRY8YawIHGPTeyjl1itqeViN81p5kliwgvX2AnmUSKEhhPxnhrLMXi/6Jr1t062ONt/c0KKDX/oaAa44DNWWKLPKBWyCos75vBPSR+YRVPd4h8XUh46pO7JzTI9X4KxxhfDc3GHUrLhlwXiMSkvCctT3viY+gwpWSZePTJMtV1rNfPDMimU2E7Wc1pSSzEzRfjwWOyFaXKsQ6Ci1+T6JkaOtILm9biAMqdg6KN8tB+4jGyyQ2ieEEQjctHZZuM1F7WPgAyGLJJG6HBw6XdZjPqvhynR8v8YfrReNSjitPNY+PK1Y9+0/B00haJAQLnjQEsiXlVRVpeJpoFNlOwrDE5aSP+UwAQ0sb9keq2AwjxAtDM906AWXJlqNWLoIDXxTrHGmcCKGDtNG4kGrzH5yFj9xXjUsnVejbPds+e8IaMbiq8X6P3ac2x9iTsk9AtB90mxUKdGqgHC1l92XhS4qt+riBIzpcKJP1UGUAEAeaAizCoHvXau2lcapf5gvyBaKG3Vi7bog2ub5WCdr5nK4er939nIVs6dg9fihX/so7iOEMZRbEBlxm+QadhLRs8 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c8b4e6a-366a-48ad-3ba8-08dcc66ac43a X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5178.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 07:35:04.2442 (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: ciPCfXvhn9SllLJQCqhMffuUVxgpM+bdYZtcRWnqDdajEkae+0lQO9g1GAEhBCjQ/gaJEVlqZxiRr9E7P4Us4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI6PR06MB7102 Use devm_clk_get_enabled() to simplify code and avoids the calls to clk_disable_unprepare(). Signed-off-by: zhangxirui --- drivers/mmc/host/dw_mmc-hi3798cv200.c | 28 +++------------------------ 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-hi3798cv200.c b/drivers/mmc/host/dw_mmc-hi3798cv200.c index 6099756e59b3..aef28cf807b0 100644 --- a/drivers/mmc/host/dw_mmc-hi3798cv200.c +++ b/drivers/mmc/host/dw_mmc-hi3798cv200.c @@ -120,42 +120,26 @@ static int dw_mci_hi3798cv200_execute_tuning(struct dw_mci_slot *slot, static int dw_mci_hi3798cv200_init(struct dw_mci *host) { struct hi3798cv200_priv *priv; - int ret; priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; - priv->sample_clk = devm_clk_get(host->dev, "ciu-sample"); + priv->sample_clk = devm_clk_get_enabled(host->dev, "ciu-sample"); if (IS_ERR(priv->sample_clk)) { dev_err(host->dev, "failed to get ciu-sample clock\n"); return PTR_ERR(priv->sample_clk); } - priv->drive_clk = devm_clk_get(host->dev, "ciu-drive"); + priv->drive_clk = devm_clk_get_enabled(host->dev, "ciu-drive"); if (IS_ERR(priv->drive_clk)) { dev_err(host->dev, "failed to get ciu-drive clock\n"); return PTR_ERR(priv->drive_clk); } - ret = clk_prepare_enable(priv->sample_clk); - if (ret) { - dev_err(host->dev, "failed to enable ciu-sample clock\n"); - return ret; - } - - ret = clk_prepare_enable(priv->drive_clk); - if (ret) { - dev_err(host->dev, "failed to enable ciu-drive clock\n"); - goto disable_sample_clk; - } - host->priv = priv; - return 0; -disable_sample_clk: - clk_disable_unprepare(priv->sample_clk); - return ret; + return 0; } static const struct dw_mci_drv_data hi3798cv200_data = { @@ -172,12 +156,6 @@ static int dw_mci_hi3798cv200_probe(struct platform_device *pdev) static void dw_mci_hi3798cv200_remove(struct platform_device *pdev) { - struct dw_mci *host = platform_get_drvdata(pdev); - struct hi3798cv200_priv *priv = host->priv; - - clk_disable_unprepare(priv->drive_clk); - clk_disable_unprepare(priv->sample_clk); - dw_mci_pltfm_remove(pdev); } From patchwork Tue Aug 27 07:48:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangxirui X-Patchwork-Id: 822977 Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010052.outbound.protection.outlook.com [52.101.128.52]) (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 E0B4518755F; Tue, 27 Aug 2024 07:35:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744122; cv=fail; b=vFTaSG+c/h/t3nDuMZ/TP/10GR6zzWk9kniqM9dTpa9c1rhmIdNosNGUwXr2e4ImMRFykUOkKoYbJoubAqJvcltR+Mk+8uWijbQbhwt2YfRREb3Eo+zybAgzrehw4+5HtGTkv+dlmUbQSarV1DYQYxcEfHGCQmz4JGNnXkJbVXs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744122; c=relaxed/simple; bh=4aWiscUrIrWILSSnO5ZL1kGC+2Uz1l3vZ+xgNrpCItM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=e4a7EKNZhcn+g0F1NAYWUgEI1kYiT0C53gvf7afDwfpdZrM+KLTDYhdzsZokboJtyyTWI86nwijMEXM+W94HtwWpI+4ZYILW01+drU5szpOYDfkaIAic2/8YSIIT8BWBWe7vqPqeCw2Z52oOtxAbxxSGStlZbQx5P9weWJbW2Hc= 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=HvrPG689; arc=fail smtp.client-ip=52.101.128.52 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="HvrPG689" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CihXSkWmts9cehcPH/sVEoPST/kOJVHr/fX3mZTNbGB4hh2553JAvbXaGvleZb2znr3Xfv9PVS3ua4ySBN6i+5xy7IexANeUwKOU13wQ8/lcJ3CC1vEWmmo+dySlPKLSDAp1GVC1dqLMSfIKD1T7iMCGWavLU3LYRImxeXWtLYrGKPF3o6jfHRoUS2IhkCP+llTpL4ySmRR5Ol1fvnaumG/D5T5j8iag/csff7CT0HVvEbzM0WOojITXFd1KidnWtxwb3FTtKPW9/jPWo29ZHFoXljdP5JgCJec9TowKT7lzTsU2J85jxlvTS86h5eSsS7Rh26qQGeCykTe9DNk+NQ== 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=SamfFhQLcWvE6N8Vh8cN3F2Yd/zM7mr1jM6WvVxLkb8=; b=KP8Huea9tpio3EqIbachlkhsHFwuZMSM2dDqdulMFVOZYAcpt9zsuhIao0Dyk9YhdBUFP4Z//Yk0tFLYUFI1/xv6w2c8wH7ABJxo6vzSNg3c22Rkz7xC7i/bIOJB7xU8F/SyvlQ7d43ROjOD6toKfkviBDt0w4kmsOPr98vNQBOpeCepxM3lNymAF2XnEbsg70iUutbMA5N4ytnNsdV0I0q7CmtmOEaYxhYsGcpnW5/KfchMy5nwLZbHrzktJhfWlHwyCANgoha/2fiSfPtVO3cMnhT4uMO0LCF/c9mSyD0OTSVdTYj6ezdSf9/CbMIo9azTaf7paTBU+TKqrbNZ5A== 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=SamfFhQLcWvE6N8Vh8cN3F2Yd/zM7mr1jM6WvVxLkb8=; b=HvrPG689ItUDkcqCM62trJba6G8/3s5c0NV3O4lJX7f485XEZttOTLWvYoE61mv31BAxHTgDKPw48nuGdjOCmxFRefD39m6bfPMiQ/ecTih9eLdxbTkOfVr8cGYLQBqcX8xyK6MfkPV84fGInKxMr+bPYSrFmzG0T0ndCCctJbTfVPI7ug+qUZJ5NPGT1Tqljv/ryYMe2Y7wFAkM/Kxo2Oz22CDOQ3d0olSzKLooN455NxaocU9XHBPq+E4eSR7+TdQydhh/NtCjfbkapJJOgGlOsO5La2iPm3xptDD0STvRLm2fRJXKO0bBDnUw+rT1GvkwjToiIG+WyTbmzwsuyg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) by SI6PR06MB7102.apcprd06.prod.outlook.com (2603:1096:4:244::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 07:35:17 +0000 Received: from TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318]) by TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318%4]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 07:35:17 +0000 From: zhangxirui To: Robert Richter , Ulf Hansson , Jaehoon Chung , Nicolas Pitre , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Adrian Hunter , Taichi Sugaya , Takao Orito , Michal Simek , zhangxirui , Linus Walleij , Bastien Curutchet , Bartosz Golaszewski , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/9] mmc: mvsdio: Use devm_clk_get_enabled() helpers Date: Tue, 27 Aug 2024 01:48:42 -0600 Message-Id: <20240827074857.2671808-5-xirui.zhang@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827074857.2671808-1-xirui.zhang@vivo.com> References: <20240827074857.2671808-1-xirui.zhang@vivo.com> X-ClientProxiedBy: SG2PR02CA0005.apcprd02.prod.outlook.com (2603:1096:3:17::17) To TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5178:EE_|SI6PR06MB7102:EE_ X-MS-Office365-Filtering-Correlation-Id: 62222865-c523-4fbf-5355-08dcc66acc0a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014|43062017; X-Microsoft-Antispam-Message-Info: PZeNEhFFG9rUGbn+ikcOvuMdedmOv+2RK1sGLZyMq4GpLDQ9jG2iGQqhdcEP2XAj00OODAGBxI1rO4ZRAX9GCet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2tQ753u/CRBD+e5YLaKZ9Dw3q6XNLqw4OmXVG292X2yfl20KDRLFIWnqwjH7EhpDl1AtVvxf4phIZ0fbEddELkRFjH6JD8EEnSTdQO1+08hAuEXNypmqkwDtUVxoHjnI2HES/gRkEO947BpZ+gOUacrRdsIuzJCNw6eoUHAO7SEOVBf4r8sJODcIkPq/fzYoLT93HCetDY1USbOATYcdeSgyzhtvucsDwZ43iFZAV9tuWW0E8nqJRPZUrLh3JW9TFgdZqXguV18rLcieeMEAKGELRSLjiD5SyYueygtd1QEPd X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB5178.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014)(43062017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vWiZR+DjjladCwK6KfaWpBX2UuOI3CGQHKsYqFHdF19IJEPhCtj924Bu96Irx0uEuZxvZVQCp08u1E6dB5kkSwNmCSZf/8CLm7QPTVXcF/6fVPGdCWV69tCwzyHBvRgzCg+1InVC0Wvpswg2Y+eYk1yesAKDtdJZgcAobxoBkQ3DC/wE6NQqSPpfcXDI1OgZIeTRCEZIHuxVeuvvgs+0BGG80ANpcVETj4hNm3hyPYCQE7UAAE4mdz/EAO39a7ige54pdKH1TDRb6/mCgo0aAfp8lr0e8IFjuXKHYZ+hZxgiHzAb0go8zYWB80n//QMzj6Xq485tdo+1/Q+3CyFOCcxGUZ8Ht+dV3nJbMbruI8nt6LXFGO9iX84hDsfnW+USjd4Uvu4HcAB/3jlx3kNcNTucj1QrownSDpr/0oLDwE6NJmXDRowst/kZpkvr/fL+SPkJnoWp5PP+9umDTS2l2J2dCvmV3/4UREBDstmh8ojOrPjqDmpGIwKY+DlfuxCWT8hmqpeP+xdQ7CAXF5jS/hh1Mwb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o.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62222865-c523-4fbf-5355-08dcc66acc0a X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5178.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 07:35:17.3131 (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: 6KAOH0YZ5JDUEfoRsslnP/EdOrC8Y7XX60tUCHop/M36gyzMkmWYMlxjBn6g00FyNjo3zFCPEjPJMOLwh7xzZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI6PR06MB7102 Use devm_clk_get_enabled() to simplify code and avoids the calls to clk_disable_unprepare(). Signed-off-by: zhangxirui --- drivers/mmc/host/mvsdio.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index af7f21888e27..c102eff30b40 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c @@ -48,7 +48,6 @@ struct mvsd_host { struct timer_list timer; struct mmc_host *mmc; struct device *dev; - struct clk *clk; }; #define mvsd_write(offs, val) writel(val, iobase + (offs)) @@ -731,6 +730,7 @@ static int mvsd_probe(struct platform_device *pdev) struct mmc_host *mmc = NULL; struct mvsd_host *host = NULL; const struct mbus_dram_target_info *dram; + struct clk *clk; int ret, irq; if (!np) { @@ -758,13 +758,12 @@ static int mvsd_probe(struct platform_device *pdev) * clock associated to the SDIO interface (it can simply be a * fixed rate clock). */ - host->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(host->clk)) { + clk = devm_clk_get_enabled(&pdev->dev, NULL); + if (IS_ERR(clk)) { dev_err(&pdev->dev, "no clock associated\n"); ret = -EINVAL; goto out; } - clk_prepare_enable(host->clk); mmc->ops = &mvsd_ops; @@ -780,7 +779,7 @@ static int mvsd_probe(struct platform_device *pdev) mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count; mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; - host->base_clock = clk_get_rate(host->clk) / 2; + host->base_clock = clk_get_rate(clk) / 2; ret = mmc_of_parse(mmc); if (ret < 0) goto out; @@ -823,8 +822,6 @@ static int mvsd_probe(struct platform_device *pdev) out: if (mmc) { - if (!IS_ERR(host->clk)) - clk_disable_unprepare(host->clk); mmc_free_host(mmc); } @@ -841,8 +838,6 @@ static void mvsd_remove(struct platform_device *pdev) del_timer_sync(&host->timer); mvsd_power_down(host); - if (!IS_ERR(host->clk)) - clk_disable_unprepare(host->clk); mmc_free_host(mmc); } From patchwork Tue Aug 27 07:48:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangxirui X-Patchwork-Id: 823377 Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010013.outbound.protection.outlook.com [52.101.128.13]) (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 56C9C15687D; Tue, 27 Aug 2024 07:35:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744135; cv=fail; b=dE7rnIjrzEb8xdQ35JIBzY8Gjr1VS4MO5CQMQl93GNBWxdknB7CVujYAUiJgwebGgzldNgFuUcOe19E63dTG51ODJFm95ze9dw7rtxRKMc1oth4+NPYZTUo0G7eVRfpRQ2ouXRWMznDza+SKdTA/xe90mn9Ny3YnYCboNp2Gvn4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744135; c=relaxed/simple; bh=OkQxT9mPY3rNO9CDFPe1k6aR99ktH+v6Vctu/6S16aI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=n0X8pCFAH9ILjrfM3P91UBVIJK/iuvuxTw6l6DGu0vZlpGmLIRyMJ7vQFFp8qg9+VQXVgsT6wj0Q6j2RhsgmwSJotaQt13NdGTayWglDAv3zK9oJQl8bo8YSLjt6UN0XX0ups4uSAlflfnwzzgeHBA/AVXcWKiJ2BcbfHOuSMpY= 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=XBBxW4At; arc=fail smtp.client-ip=52.101.128.13 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="XBBxW4At" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Md+XJxA/2JgnI89xASuVXB+nud5SUsfYXfHu4UEQVIo1YmS0ghU98F2gX6zUXv2s7dr7KKUTfTr4fWWksd2L6NKuiFCf4rb5zAjtJPW52wrbiKBVVNRVCgCuAD4X3vA5uD+Gdorgbx1ulxLZxMxkfFs73tHz1HMn9DEV0BwUWI71Xbo5oY0+M6u8OPJSaKx/YfkCUF4ZhRFVBFgsITGN1CaBiZjhL6CMGLQMvxFqOB5Af2oqJfuw/HC4Bac2zqyjQ6/ENTfRTSvrJvKWbZPbEBus4ISyA/NO2i0GDfr8/e+2+JBtHkRFEa74E8b4XxNyGLulTvIwEIaedc1jnPKygw== 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=YbQUafBp9d0BR4mWRArTDewOj3yjWNb8GALNlegDChA=; b=kn2zKflT/nrVOAanmStwEDIqXUr2wS5Pe6gJWNMdscYTXi5JDedhrg/xA7VGWkyKDmtkvPafUSXw9+9BS4jDTN/uTJyzyPzvSalpUGce+LJQGaYrAP+htH3SLct6xdTjp6GJlmMbUU6KnKhfLwCLdxnmxrhk2XjgZkMJzPa3pom1gJC2zqCu8Cnr98f+K3Wm6IZUNC4UXsSaqUdQewnHijSSlbO+4IDj4kbIwh/nU1SZNUKmPv72X36dYAePM8Ovzuwclk//+V//QkF3vx1wkaGQ/x5qa03o99/iXCbJgoP4OhRUwzCV2PKMhjn70Vohgo76KMM68c6djBtbni12hw== 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=YbQUafBp9d0BR4mWRArTDewOj3yjWNb8GALNlegDChA=; b=XBBxW4At0hbHFGqXvB7rrcBVwlZx9Q9TAXpUYqopxIo2dUpwnZNUYjJT7uEwoVK13GxHq9M/Kis1+42XWeVzTlVh7CkQGWmn25aoKI4hJUSDr+IJ7WbKTFM7tmaR/exE2cNbgDNd3W6ihjgwEFO3ZSO/Lm83Ml2n8AjTpduTguixEDJPCeU+5gV3iDrqHdSp9nkYzR3erNOG+CxhRMR29tbIzV0nZeuV0LM4J9r+6VFpfcfaXFJ1BxyT6FrMGhcjPyFfirm/4JYbp6O6/Wafazm15xhL8ar4dzcuIMVCSUn3fPEFYzBTxK0KUYOzi94FEYHtlG72oV6USmi6VkK2mQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) by SI6PR06MB7102.apcprd06.prod.outlook.com (2603:1096:4:244::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 07:35:30 +0000 Received: from TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318]) by TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318%4]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 07:35:30 +0000 From: zhangxirui To: Robert Richter , Ulf Hansson , Jaehoon Chung , Nicolas Pitre , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Adrian Hunter , Taichi Sugaya , Takao Orito , Michal Simek , zhangxirui , Linus Walleij , Bastien Curutchet , Bartosz Golaszewski , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/9] mmc: mxcmmc: Use devm_clk_get_enabled() helpers Date: Tue, 27 Aug 2024 01:48:43 -0600 Message-Id: <20240827074857.2671808-6-xirui.zhang@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827074857.2671808-1-xirui.zhang@vivo.com> References: <20240827074857.2671808-1-xirui.zhang@vivo.com> X-ClientProxiedBy: SG2PR02CA0005.apcprd02.prod.outlook.com (2603:1096:3:17::17) To TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5178:EE_|SI6PR06MB7102:EE_ X-MS-Office365-Filtering-Correlation-Id: fdadd016-92f6-4e72-0535-08dcc66ad3d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014|43062017; X-Microsoft-Antispam-Message-Info: 8VdGiYYltQBwo5uQVlaYYQ/ssIoW+3c3qOBAnA8jw2oWFy6eUTReAf3Ea2biBTwwks5hxzsc6CHw/Glo/xZ0LvL1uhloDnTqTlfBJYthERHYXEWAwgepdIgBQWbZNESjprObque5xVXd9Wl7C/L4A76EnHJ0bzz3SfivyjN5HgJntbPruy0rXwH+TwGnFXmynJg8zaj8yE20FURlSaJVQ9BWYFsOcFqlKMFEyKDfhKadN/Ai8zcEHpAfryRGx3KrvjpRzV8kCDldKtW1Qloq7bz0o+E4TRsW2LLfU4YtnoYonUaUKsyQ1qsURbeahEQ268G+2Y/H2Azr2RbrUWfRRBYxO2EDnRnQom5mUQvWzBC0qFF5I5W9OBz/DcmfPjDMBwJCYpXC9FptnytuLx1AAnaXVc9c9JDfB609Yez3nffzS4yZBf4YlWPzxQOly7LxM4oykKk4R4q3po+hTqtjsi8XLQyBRV+8zuZt1xXIHMC6BEzCNCLyYZUuNzYnA+onLlKZFltd8xdMkTlpi5ipd6xEXPSsJiLkAjSUohPxoU/uVDBI5P3JNK11o4cJ0dCpNAJli0rOMqkH6PBD4Bz4/sfZ0Kp5ITq6zfQ15tIrfKsqLATYfWGeiLMB0XhLP3Vw9rhwFuYcG/5PCBLYeHxX1e/6JK1wMpE0gUJbdvCvxxtqL6N51JLmSlHvOC3T4LRAZOaPhUCBOawhAkaF1Ezx5FVR6aM2iTorcVOIN1bth4GDSHt10O5P7N+PPqsu9xNq7SRjqH6UxWTKyyRsJ6Yfx2LOAY7KT5s9iHvZgn/F2Dg7B6KE1iAjmwxaWsbAKxytFbnLxYnvRISzUhE7thEGMVljHOhq9NTHP9fdezI+h+0nnjY1w72wQgIcNtfXWBOjWJMmpvflUGW5+YVIy52wE4ONk0c7MzUZI6rtyjMcyjQdS8Py9qkI2rrtSwruOIb1ORtKedl3SUNYlO03myt+GHr6/CZ4UlNLT2wUSauvnZEHj8UcrVxj/OggHT0Nup4bhQUN8YrPl4LYEoPKcJYLr7hz/qpX0HDAAafNDeofK6lBAb8SmSbb8M5SL1/CQ++T0Nv2QIpghQKnESejDdntWTtnlTD15dRaNMoCVAUTNGT80ay09HqTMSq+/4eW1QIFLyW8kwlBd3EGC20n3qsezPqaJ8YH+eKJJ811YEQBQaDTsFffZghgVsVndKNnjmphJNaqRxAttFUKRxoOxjzu5tqVbUnWc+IUcNyvw/5zL5njbhw89nsyDSIhxWcAIbvGdGYDjhfhtOdT2ZmX5bgBctyc6U3U8EuMhwGREvNYk6azSf6vAWBhbSmmIPNmbRHJ46PWBTbT89WozFgieOLM5LaM0GvQlvi5sABgJW8oZm2e9vzDe14VFkHG8VrwgYOOtVuH9tAJcc6rDgLnB/d3sOj/0VtQ2PfqFkc0PqBvQ7erD+2BT9G8R/jluMKSTpv6 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB5178.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014)(43062017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HeaUkb1NVxwFBHTwrcS+72XkFLDJCCd51Uazy4meuoieL1OwFGtzdvguHdlzwU6rxfE0om9TSoCyj1QVcsCjBsC2NkZ7rkLc8uLfyJxLqnU7sAQxF3JAfOOJCjBEUB/CS/4RhtC1fRc3KRIcEDm0xQajgS284Iu2kKFO2ds3tgyM+u3wRONtNLI5n4PtM1ozlPYGUd6eWB9nrnFxl5E5HsqNmJ8t52oJXhmh6qjSDZVQtBij51jGaCoOMr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FoRR8xAHmQJVTFfokF7XqEjFxxwjQ3FUE1KWS5NFvjfrgqwinsk1Mdf11B2ey6W0vAtFpWoSFlIQrXaSeyzj0yyKat8vInIyGpvuFhYjjqSaZ5A1QmxUwZSsk3dPjCA6Z5h9x6HDEmnjm50q9bOUESrXeMd8BLTtQNfcisx6cVoQU5HcFE5AaNF4dOLi77W+ABNvNXt7sZn6jBg0waAVQPaVYS915wpmewvXOjgGhJqUNhNvsZ0i7S29 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: fdadd016-92f6-4e72-0535-08dcc66ad3d1 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5178.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 07:35:30.3551 (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: svEVySu+fnOLINEkf2yiOsZl+zVdctDFb/wmV/KkkFLppL70TBVKYp+X2BRpnuyLMvIUTCRwxllQmZ94mqJBsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI6PR06MB7102 Use devm_clk_get_enabled() to simplify code and avoids the calls to clk_disable_unprepare(). Signed-off-by: zhangxirui --- drivers/mmc/host/mxcmmc.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index 1edf65291354..171e1f6a5611 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -1069,26 +1069,18 @@ static int mxcmci_probe(struct platform_device *pdev) else host->default_irq_mask = 0; - host->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); + host->clk_ipg = devm_clk_get_enabled(&pdev->dev, "ipg"); if (IS_ERR(host->clk_ipg)) { ret = PTR_ERR(host->clk_ipg); goto out_free; } - host->clk_per = devm_clk_get(&pdev->dev, "per"); + host->clk_per = devm_clk_get_enabled(&pdev->dev, "per"); if (IS_ERR(host->clk_per)) { ret = PTR_ERR(host->clk_per); goto out_free; } - ret = clk_prepare_enable(host->clk_per); - if (ret) - goto out_free; - - ret = clk_prepare_enable(host->clk_ipg); - if (ret) - goto out_clk_per_put; - mxcmci_softreset(host); host->rev_no = mxcmci_readw(host, MMC_REG_REV_NO); @@ -1096,7 +1088,7 @@ static int mxcmci_probe(struct platform_device *pdev) ret = -ENODEV; dev_err(mmc_dev(host->mmc), "wrong rev.no. 0x%08x. aborting.\n", host->rev_no); - goto out_clk_put; + goto out_free; } mmc->f_min = clk_get_rate(host->clk_per) >> 16; @@ -1112,7 +1104,7 @@ static int mxcmci_probe(struct platform_device *pdev) if (IS_ERR(host->dma)) { if (PTR_ERR(host->dma) == -EPROBE_DEFER) { ret = -EPROBE_DEFER; - goto out_clk_put; + goto out_free; } /* Ignore errors to fall back to PIO mode */ @@ -1163,12 +1155,6 @@ static int mxcmci_probe(struct platform_device *pdev) out_free_dma: if (host->dma) dma_release_channel(host->dma); - -out_clk_put: - clk_disable_unprepare(host->clk_ipg); -out_clk_per_put: - clk_disable_unprepare(host->clk_per); - out_free: mmc_free_host(mmc); @@ -1188,9 +1174,6 @@ static void mxcmci_remove(struct platform_device *pdev) if (host->dma) dma_release_channel(host->dma); - clk_disable_unprepare(host->clk_per); - clk_disable_unprepare(host->clk_ipg); - mmc_free_host(mmc); } From patchwork Tue Aug 27 07:48:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangxirui X-Patchwork-Id: 822976 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2057.outbound.protection.outlook.com [40.107.255.57]) (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 2EDF913C695; Tue, 27 Aug 2024 07:35:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744149; cv=fail; b=gs3nayDjdJkJAAFTS0O2OOi+Z30hwQWDWGAFBFqT44tUnxAb7+HBicEjoBoPra2vlah8a5Uegitxgz3GXhCRmry2Dby0WQz5ljClEM54bd/XnvrFjyte5r7O9z7t7CUcicFFCV5WBgjoPDTfXDgunvaAuHHAUq15c9MJgmKc6oY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744149; c=relaxed/simple; bh=xDvCroMp0aDXU5rUbuguUFC85E8aiQVrM1RYvK6vjzo=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=h5IdUPL+WTNg+OUv7GbjsejI4+Dwui3wfJXTHxrGxbPpGH6YVVfe+xHdpahUZaj0eKNX8YmG5Lk19fZ+ceRPSGztOSBIE4W2G6mryRDuGhMiAJfmb9UmC6LPQQ0AMiExPj2PYzG5epgABFGKeK1aozYCgkUbZDtvGcmY5wEK6ZA= 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=P2q+KYp1; arc=fail smtp.client-ip=40.107.255.57 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="P2q+KYp1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TkazcKgoOm/iaqwfmTxjJy3ELuBg1i3q8l7i19mFJ/jb1KcTzoumGxdugmvjF5dsgFePAMUFsd0cbyDdjrLJ6NyFvDfQ7tTIHzE7nodnqNSXH2hm4jqLuzdLlv+0jbdr66+pOExpNDaW/zeRgh+V2xlyauM/LKc7gHgtiBGWjUmDbUjNsT9JgB9kbY7GCe6qfV5fTM3ZV4AdiRt0cp7E8cqDd4X8ShVzj5elKUpmMomq0jHtnOWAQjizrdvBlpvXnVVV+PdS6+RwQuHeSkVJzDydesK6/qSd4fT+t19rVz4YNEEtXJWDmWEb97cFX7AhdYZz7hkE1MhFZjoXYa9x6g== 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=LltO6/GeL5VjOeZSLuuIVsg7yhtwm4dguIk0sohcj24=; b=dYyJPvsZUbrVEpP8tWdjo2LLyfL+GssOYCn2fJtODlcHRv1aqhgt0mBjkPeah//rPn4Gi4BKk1InryVbJx+VuYZLvldFBgAtCLdmVa1LMpLRRIsXeeoeGwJQVMtIFQD9FUIgnSkD8IsgXJKG4avrx3HT/IMg8EqHcQLs2qUy4oPAHukT4w3CdXZ62tuUF+IxaH+QIesaB1KR3Y0QRJoipnCtAJj++A4JZTa2IDRY7txBx6PJ0zcl+voPmPDEnqTBmqxUhFsN6tAz4HkD3E9vZqUnZxj3ShUMWuxcvJVyDCPrbwIYfkhfcfigprnJow+xDKbRr2kNviETVi3N4khDfQ== 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=LltO6/GeL5VjOeZSLuuIVsg7yhtwm4dguIk0sohcj24=; b=P2q+KYp1Xu9pR6sRWY+LaedBQKmGgjsySP2tgP8KkaRoeyxy2rSvDV7u3kr3cw0pLLwN+2DrLjVTDh85jjv31RLRKmtaqWHZ644J2djoUaoRWzsynb8V0GNsCs9mxHV2at3hEu4Hrv0Q7yXu8s5kMt0jKU6RXGxL7Msy1grhVzRxNdREXa4aWzflPYXYK50HHwZA0/jiZC9D1Tl6EusCoL4Cxeb+FXsvVBW7/sWUQIINeJc5wDeoZ5mQP6HW1TvPbbwTqVo0T/rRYm43jlEM/QkvvgLU0p8by251CWnfc/NySGE4LhwM1bw+7mhUMgKkNntnHe7gfdGVhlTHIkpmrw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) by JH0PR06MB6656.apcprd06.prod.outlook.com (2603:1096:990:2f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.22; Tue, 27 Aug 2024 07:35:43 +0000 Received: from TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318]) by TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318%4]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 07:35:43 +0000 From: zhangxirui To: Robert Richter , Ulf Hansson , Jaehoon Chung , Nicolas Pitre , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Adrian Hunter , Taichi Sugaya , Takao Orito , Michal Simek , zhangxirui , Bastien Curutchet , Linus Walleij , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 6/9] mmc: mxs-mmc: Use devm_clk_get_enabled() helpers Date: Tue, 27 Aug 2024 01:48:44 -0600 Message-Id: <20240827074857.2671808-7-xirui.zhang@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827074857.2671808-1-xirui.zhang@vivo.com> References: <20240827074857.2671808-1-xirui.zhang@vivo.com> X-ClientProxiedBy: SG2PR02CA0005.apcprd02.prod.outlook.com (2603:1096:3:17::17) To TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5178:EE_|JH0PR06MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b4d7a21-e3bc-4e46-429c-08dcc66adba9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|7416014|921020|38350700014|43062017; X-Microsoft-Antispam-Message-Info: oUGHR69KcSfBZ9fXidkc0awaPTcbVjQ4ZT9lR0+gbW+3Jg8vz3qnhIMz5sE9+Jl4qsDX+10K9ysIiGgF727v+Ahgv3RiVOmGL9cY//S7RjlsoaA5LKqwM6y/pG0aiuTw+sPKgQh2Q9/LSst7ZWJDseTGxXVZiO0C3OmZ7P9R39Ga3xMjbAlKgygzjwPurC+5DEROmw0VtOORyQOFPEokv254tWqdxsnFC5Cwr+Uu2YIW/EsLio0LpGW1S1PBfo/re+tQehcjlATc1NbHDv7tbbpjJFxroHIRixKttkcmn2tKYnxTtOOu28yB7mbuupt4i78VFj90mhaMbvrfRXU+WQcbtsicuCGa0U9+2CVUVdZTplLsuyjrrgEA/Xqm5qT9kKOeMA4K7kgGBsS9rTiENKWdmzT4/5IGh/FxyMzdp/jeC6bbNP/xbXsdHDKhxvTPmdW9sgTWAFL6sS3S32sNqmCo2vSccPa4hmZgSsR0GwZsfFfoqwKRB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.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014)(43062017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: syvw0mq39mJfg7RPiKvR28aryT+BBtn2H/rz+eTqZgVHwc/9GWM6PHSs1BbihTKHrodRNpKMSQhbZzLakzJ9lD3E4w2SopEYZdYqqR87elsnFPhponEUe+IYr0KG5VJ6AvAcFp+rLOvq3QNvaqhevraRDwhsVGKVInsnabZ9udPZZBa4g2Yftt/dgy97jKnGzt05QZnQgcriDhjPCUayd8gvhlNbROUzCOsWGv/dCpZafTIwWtLMbaEzgSJTJrxnkadKRi2XOuajEg2kHf/3GhDo6Tm/lg8XDcIoGmRow0DUxyA8lTP7g4R2sU9gAZMeWof9QcFO7nIFGrNCTm4BN8+FVU3WF9c+Ir601x21dCY7y8mMxrtmS2TLGU7oa16VgsxlEQ4K3dvdtX7p7ssvmvXfMttMFL75Y69p7uo6V8W8OGnirdx4Hso3RK6EHhU3bktp+zoY3Kyt/hJ0o7antaBlGkBeO+j32FNnkqCioGd54hNQotWPpFz/k8gmnHLYCwfsfqiR2MiRVuCJzLcE6UT5xgIGlpHjtM/13jnquvc55yqVCugogU2+uZbohHGRZvxA+8doRVMgXSwBKr0AS0ClcIanYxGzL2mMhvc1twlXEcrtkQhmdNRPE9rUeiKPAz0sh9iCAt7N+7JLCYeAa75ZlsqJ9fq00w1QofxC2S8cMVYLGa5unDmgFHg5skMMP4QbkRzkkq0kViBzrLyWHwFsJVly0YfAOqZ6LCAm4++Jo7j8C6YBA4RS/sopqTTUl8Iu47340Axx28KqSgXpNUmcCAg8+/ILd+JYD9gRB0zP5f0vHqSszRZCLfRjl4UW+yRptg0FSkdG8MTcEApSufYdM6ZDTBfAPKbcqchYYuRE4RSxeHxM+PPGnzia+LApoyLhr4Q609DllVFEUK9U6UJFBIVvF/yuqIAggXc4EGTJxWGqJIbWxGxFvakcbOxtjx1bBVAjkZC5/tUUM0RmROTTIHWPy3YnqSig0HDd1XhVwjDJ2EovapMXYbEtm+dIjJXeyEdv6UiQEqloTXYvXLI7QYL+yIB4My++UzU94k9IowtiRUGA4EPyg9YEGNUxsVAN9HDiNjy0qL4jSlbVyo9grDOf9um7YDL/7lLVcmfnVfKzWDB8evy0WVYblKa8vTYDGSt2ELnvb3X53k78KDCpPmbZZnK6I/MrHvol0Y+nEypXTcazBz35ctwdJmpsyrMsalZFrsHCbrVal/Uopj6Pj/ozFkbNPhC9JY65AmmxSBfGDqry+C0RIc9xx064JEesfs1DN2PqObMxw6VydxgTIkEjOSpRDYsR+YqY74mBLK0LxGRd2gezfZQqR1SbXyPKWUqS5BohITLrzwVrk5GINGyLwlLTpHWU0DjS+kkKynisc4pGaDDFYPBX5Xyr07YBxk0OvwzRU8YH9ESPKAE9YVFYsLXicxZAN5SHPRCbUZ2CpTfNDMUBB27DXbJmaO4PYk9ij2LQBPpN0fjhZCKG2oAnXHvKkXF/dudwN/rVfUi5GThbmzKrjcVS3Wq76ByIdf+dAMN6tRMSzzlAygMJho5WojwssnY/re4pMN6F1iT49g7pdwT6QJxcI4R3 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b4d7a21-e3bc-4e46-429c-08dcc66adba9 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5178.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 07:35:43.5203 (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: IeW3m6Ev4ghgwZcpKHZ0CqKWU0S0AIbfqWSrEeh+cGoSmg4pwkqzVtnatpgiwUqeuCxXoRL7sjx3fEB8aT5Elw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6656 Use devm_clk_get_enabled() to simplify code and avoids the calls to clk_disable_unprepare(). Signed-off-by: zhangxirui --- drivers/mmc/host/mxs-mmc.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index 6751da9b60f9..591b5a3ad6dd 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -602,19 +602,16 @@ static int mxs_mmc_probe(struct platform_device *pdev) goto out_mmc_free; } - ssp->clk = devm_clk_get(&pdev->dev, NULL); + ssp->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(ssp->clk)) { ret = PTR_ERR(ssp->clk); goto out_mmc_free; } - ret = clk_prepare_enable(ssp->clk); - if (ret) - goto out_mmc_free; ret = mxs_mmc_reset(host); if (ret) { dev_err(&pdev->dev, "Failed to reset mmc: %d\n", ret); - goto out_clk_disable; + goto out_mmc_free; } ssp->dmach = dma_request_chan(&pdev->dev, "rx-tx"); @@ -622,7 +619,7 @@ static int mxs_mmc_probe(struct platform_device *pdev) dev_err(mmc_dev(host->mmc), "%s: failed to request dma\n", __func__); ret = PTR_ERR(ssp->dmach); - goto out_clk_disable; + goto out_mmc_free; } /* set mmc core parameters */ @@ -666,8 +663,6 @@ static int mxs_mmc_probe(struct platform_device *pdev) out_free_dma: dma_release_channel(ssp->dmach); -out_clk_disable: - clk_disable_unprepare(ssp->clk); out_mmc_free: mmc_free_host(mmc); return ret; @@ -684,8 +679,6 @@ static void mxs_mmc_remove(struct platform_device *pdev) if (ssp->dmach) dma_release_channel(ssp->dmach); - clk_disable_unprepare(ssp->clk); - mmc_free_host(mmc); } From patchwork Tue Aug 27 07:48:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangxirui X-Patchwork-Id: 823376 Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010013.outbound.protection.outlook.com [52.101.128.13]) (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 B8F08155C9E; Tue, 27 Aug 2024 07:36:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744166; cv=fail; b=q0WO2eoY+biGTu/BIbzLsWFbv5rvZQzs9BgVbcnC63T0XbicQ3BcGjvR2e1iC4bsAYMq6UvAUQFdIskg+gcbqnimO+dXWFiwp0R8pMsOmHTmGnrHNkzzwJ9o2Giqu9OfSDmRAzRF7EMw/m4w04Ng9LruFJnSpkjpcLOrida+xc0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744166; c=relaxed/simple; bh=oB1h09ThyZNkDo7GizzXTc/B+4i55hU0bHc9kDPRL98=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UENvCbBJJ545Ad2baHRVwJt+h6Wr1eAG6op+10X3G3SwUspV6roZk6f8bqvvBlNRrdYRvLIXJhx0wQ/GMtWBpSo3H1dIdyLhYRAtW+BWLho1Rrhw3pRf4yZ1sTGf614u+sn65aZ2UTJg/MSSXLQeCRg+JWVhlXtX1w6p9NfIN6w= 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=ZwPCSyk8; arc=fail smtp.client-ip=52.101.128.13 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="ZwPCSyk8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fq5/e5/E5TUq9IDtqgN54pbT9HYXpAkWKsh/Xv0ZsirorJyhcihxa57x0DaVtaq5cJxnbeIgGybuGybUrAtgcpwPfGul0wux7GZKTF+t/x2o5Tnr1s7c7pdCPstwkG+641PPg+zNgxlqUGxyaxIGIgODZb9V0g/KkbVa9RZ/VXAezt+2Q7ATL1/vdaEFfbtL+Dg9o7hSY3ZxEM6kLLfDUKXslRXJ2eJzc3Bd0DLx6dTRrULnBKU4hZI56kjnNuibbVPp2E2SWHmoEPLLjnYzpeQ9PaR6QMOZNEWXLjnUNcW45qmIrgCKeAQVd4MywzBPZWbB+R/7nzYhqRwIkZjB3g== 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=gPJBExZK03MZKRGwDrFzKjbb+YooZH1A4LimPbJTXKQ=; b=zFbtKYyW3yh5/EnCWbzyDiyHWrwofOA3oH0LPahZg7HVsALhwqJE6I5PduGsB3zyKle6lie4ja6/o6X75sWa+svf6y2nAjourp3BakfZkUma4gbVEQPh8N3yfmnMMVj2WE+Xv7vkPTUUNgbSaRN6u16qAnyX7mkAAjzo3Y8NZ7EiXmis37RTQAntXMuMlVuvmZ3IxKz2zVLif1+roOFnA1oSBXtsC1zoseBNmyC3PflQSae3e7Zo6xIMvSWZ3dLj97Tzmr6wjBrDZUpDFETaFgHhompRq6NV3MsAfrZDvx4R0qP3qvdhpEbexL6VNRb0QzDcg6s5mhTkTdCa+qoXqA== 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=gPJBExZK03MZKRGwDrFzKjbb+YooZH1A4LimPbJTXKQ=; b=ZwPCSyk8ipbbuubhHAc3swSZRZ4P13JIfJOsGPSvZOx3GvxgTJoP9Z+NXXUilegTO7MlMFiMHajCQIUq0/ygYfciphD2A/6+Py9cfQhk9aYbor0ft6Xt69HI+HpcbEKNJLQW3sRFf6vhd9NKYtOdl4Q3RO4bdd3Wtjcc5VCdeIdNA0AJCmkJNnnnYHk6rfvHjjfXV5MLOF9Jo30BD7XlAbJVB4E+XUM2X7yKN68Z4mNBSgjWPHfewGc7wYJVTSe6b1d3F4z8g4kSrhD3s74BYzo7Ix8YtKcFdsI+L/Z3a73FB3bMl3tpQw6JYB9GTB3+NBQPBZLKl2BDxt3WIi5qeA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) by SEZPR06MB5047.apcprd06.prod.outlook.com (2603:1096:101:44::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug 2024 07:35:57 +0000 Received: from TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318]) by TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318%4]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 07:35:57 +0000 From: zhangxirui To: Robert Richter , Ulf Hansson , Jaehoon Chung , Nicolas Pitre , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Adrian Hunter , Taichi Sugaya , Takao Orito , Michal Simek , zhangxirui , Linus Walleij , Bastien Curutchet , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Bartosz Golaszewski , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 7/9] mmc: sdhci: milbeaut: Use devm_clk_get_enabled() helpers Date: Tue, 27 Aug 2024 01:48:45 -0600 Message-Id: <20240827074857.2671808-8-xirui.zhang@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827074857.2671808-1-xirui.zhang@vivo.com> References: <20240827074857.2671808-1-xirui.zhang@vivo.com> X-ClientProxiedBy: SG2PR02CA0005.apcprd02.prod.outlook.com (2603:1096:3:17::17) To TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5178:EE_|SEZPR06MB5047:EE_ X-MS-Office365-Filtering-Correlation-Id: a095adc9-4625-4049-4f3f-08dcc66ae3b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|7416014|376014|366016|1800799024|38350700014|921020|43062017; X-Microsoft-Antispam-Message-Info: AkdrCBMoD/vL623Sn1pIYXrd/atW0zAjDIhO2crmPdw7Wmaa3vGsz0CyJHmFepGVgvzp7DvQ3UtXoOjo8HfUADp7GFJZSXZdLe1nZM8e6hKRb2NBNtQbE6deGSlU2sStpdute2GyNywEUNCkFteIra+EHWwMBu1jhVMNDcGRsPU1W9Ab267TPBuguFQCgIevyyviiHkzkufGN1KreQZA/ziJ9DQBUU0mNrMMoW++akaRMvQeaRfs9hl1lIgeDWAL4gUQ4kCC9TOSu1SYJcW7Qz9QwpLgtIBk9LE7Qp94PQO5A2FPhKn+329LymoSXRA5F0D8tQwETuw9rt/viihQJdGY4h7Lig8H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4t3x0Qkn2zHN8M8Q72gitn8ToFWkSc5R+oTD1Ay X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB5178.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(7416014)(376014)(366016)(1800799024)(38350700014)(921020)(43062017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jG4qPfrFm9NsB6rybHWVSfusb5QOYni3C8sxJhDqjJ+c1n4I4Jn7eV67uFEYNpVdkb11FScwOcbA/ip+M/gtJ3zsyTcCJCL4fGynjgTslbx5wL1TNjjOB6pV5QwpWu4tjW8Cx25gn1l3ZsetLSrWMlkNksPb6LpBr5ikdTgo10GkntvlJVMuCldkf8VsOBhzFi8aQD639EvRpm1yv266MkpcBLCA/ZQaWyetUH3qvdco+TRuYcOx9sZO1wTOY3M/wGvT0heV5SeAursOiHSO07YHtzlmMr/fjK0CyZTzuSKmCfZmdqqulLE8sfDr4DUladZ8c2KYXtd/v0zcbQjLRKFDtSDZsXtHFMsU84342RKTNg+fqN26tduMVDGkFBC61c3Qik6DMLIV9ytPq70X/4FkyrJduaHvp2CNv6AG2CkZsJgdLsFhDkV3VTlSCdfmp3utSEZtLVEEtPuMqT0BSQNi+H7zxwCeHRAtXTnQas1YCJDtKtp/0s14qnoIAPgroUKhto7Zl+tVxEipf3mZlUm7ShBIrDlx1HDZjikQ7wIZkHOWHMpn3V3ojV0Yuy4vlgV0jUVJpaLI2IqoZnNqQr3hA7TUbjfGE9YDN6GJxqrXRKwoleM/NHHqY0jWpdfjmrlxryRDLBQQxdjiHfRGcXVALhsWhXgECGVxKWFUbWPt4zaWpI3w7P01sz9pdlqtzNbi2PLtiKGcQlsFA2Xvihjlb4UF3Jh/pYMjFgmQbf356SvtH3LKtLSpOe4X/ccvrUc2eqgsZFb300R1j+hJxnVyHgJ4Tr1wnNJs7jNdzuXN/SaeUEKzddeSh8YKJ8kO8ZnsuBXQ3xQJMZc6Jl4/OYIkWdTvRQe7nRhB1CAUGsr5GLFuB7W4E6mvwUhzrKSl1nz4OCf0aNLgp11sZHZ6HgDXYt5EsSDc+HjENDtTZTmyPNoxmhDQ1kecHO5oabPpWnyb/d5JiWF3UhFXfshl1C/D39PJ2MwLxuVCro1py+C+t57nU/gmOukC6HNFxqLhh1MymaVNFZb8r5sRAxNgYDe0Wcdxtur+v+jPDPm2dXFEkl7nNGsf2Rxv/vjTMjB0uwTQkj/iZFU6vgislVNuambY84rktHQ2F124jakFUkieJGbY7ysvbWADDXOGuRcc4bHODpl/mTrI4enKBnra0Z6s8G0kK7HRLWZOk5J2UzbfeCqwp59uHABLiBprr8DQlirRjf4ccv1nMYHqqWJ+iHetw+sbrhMzyBEgVcPwyyy6t1BOhEv2zE7TGX7zpENLz3CiiM+MVF/hJ9nhbFmndD7qCKTXE01w+N9NcIfpoxrxP8SCkM96ojju2rNNtcTMFu/4Za2duqNijpy9hMvL7Dt00OTpm9QXLxAPI1S6l0vxB/D+royJ+3THa4TcUxBOUZsAcpWiqbMRu6QAaKJWowMuzO7lFlH7zpldrDAKWgB8IoODu+S05qpL5CZMKxI0zzn6yTBaHIxqn2yPaIfLLzTGqC+Qk9bImDhQJ26cSbXERYp89r8pulNZTW3S8IPOw2KRUzU9ZQv09BPqrsHv50GoaR7yBW797tKP8A9qkYpxIwaOEXZutlUUknH3invN X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a095adc9-4625-4049-4f3f-08dcc66ae3b3 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5178.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 07:35:57.0077 (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: krKcPgnJfSyWHkEvfHJ9SvTVWICYZrtftePIw6vSO3iYyhL1h6bSUrK/QN6quoqPbJZB5TGiWs5d2dpSqfs+pw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5047 Use devm_clk_get_enabled() to simplify code and avoids the calls to clk_disable_unprepare(). Signed-off-by: zhangxirui --- drivers/mmc/host/sdhci-milbeaut.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/host/sdhci-milbeaut.c b/drivers/mmc/host/sdhci-milbeaut.c index 83706edc9796..455e1e695ad6 100644 --- a/drivers/mmc/host/sdhci-milbeaut.c +++ b/drivers/mmc/host/sdhci-milbeaut.c @@ -275,39 +275,26 @@ static int sdhci_milbeaut_probe(struct platform_device *pdev) if (dev_of_node(dev)) { sdhci_get_of_property(pdev); - priv->clk_iface = devm_clk_get(&pdev->dev, "iface"); + priv->clk_iface = devm_clk_get_enabled(&pdev->dev, "iface"); if (IS_ERR(priv->clk_iface)) { ret = PTR_ERR(priv->clk_iface); goto err; } - ret = clk_prepare_enable(priv->clk_iface); - if (ret) - goto err; - - priv->clk = devm_clk_get(&pdev->dev, "core"); + priv->clk = devm_clk_get_enabled(&pdev->dev, "core"); if (IS_ERR(priv->clk)) { ret = PTR_ERR(priv->clk); - goto err_clk; + goto err; } - - ret = clk_prepare_enable(priv->clk); - if (ret) - goto err_clk; } sdhci_milbeaut_init(host); ret = sdhci_add_host(host); if (ret) - goto err_add_host; + goto err; return 0; - -err_add_host: - clk_disable_unprepare(priv->clk); -err_clk: - clk_disable_unprepare(priv->clk_iface); err: sdhci_free_host(host); return ret; @@ -316,14 +303,10 @@ static int sdhci_milbeaut_probe(struct platform_device *pdev) static void sdhci_milbeaut_remove(struct platform_device *pdev) { struct sdhci_host *host = platform_get_drvdata(pdev); - struct f_sdhost_priv *priv = sdhci_priv(host); sdhci_remove_host(host, readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff); - clk_disable_unprepare(priv->clk_iface); - clk_disable_unprepare(priv->clk); - sdhci_free_host(host); platform_set_drvdata(pdev, NULL); } From patchwork Tue Aug 27 07:48:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangxirui X-Patchwork-Id: 822975 Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010034.outbound.protection.outlook.com [52.101.128.34]) (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 1CE99155C9E; Tue, 27 Aug 2024 07:36:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.34 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744174; cv=fail; b=aSi/ABwbPD5THpLDDtkpMx0canuLJUlm9uUb+OLb69U5cAfyTVXCUXzkS40nRaazICmOodoZk5vfk2PKH5yAs2/GvX5ktK3P24GBkug7uTklNKdJ8AmxS5zTayQjQ6ATmuJ54P1h7DeXBPANT6EU4aNvRWqk+4T6m9KwzCW1mBU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744174; c=relaxed/simple; bh=RDid/tL5/00Wf6CCa3ZGj2PbSRHOm2YsJ3uzb8tZ6Y0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=cNAz31HRZSa8hI1pT6Kye1HOaNnAqRRzQkJRfeAriDHIh+99cqatHtc4n6OiN5bCZYOTeTiEDNYvTnpM9HdYgDsBvcaejXzpWGxcRnoA8JW83veei3AMcp4Sy2vfDS5Hx2HBMxTodcqjDMO2fj4EyhPrX3hxx4fJ0aGyBw657oE= 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=oZtBkMZt; arc=fail smtp.client-ip=52.101.128.34 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="oZtBkMZt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NuCfRD1TWCSN9jIDj+sTfoiOK/+hMcshq3sU12zLN02yCnAgSOlILewNfeyqcseGO5MHJz6f+BcCNKJyeTG2U1nrLcWd0bKlaKfesBsnnqEIO9gF7kCAb5veVGLNkbWgErvuOiPtWQrHFiQIyWjRS7AaroDQvtbVcT/4YEhvOY12Sngmvt/SZjtl/PPP5bB7kiMdoUqtmO1TuEQylm3no0/ZopppI28XzyJuX5R6sS6NBsrv/HrCSzPUsvCKh6FZ0KORAVfz0xIJnlmQixzdTFG0ebb0E0OMaiZfyk4v2Sl6FpUc5mMpHriBc5EXeOBCL2XSKn5JZ5eslU0LIgnG5w== 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=dkpV+tQtXNR8gyNVTilzqm1GZllsQl7RH9cQf1JVoRg=; b=ihUCasA8kTxN++ykGtCOOXSqOe4BMxE1n/9WNTXMemyXuczEIt0Mhx04Gyz8vN3gadEz1p81mdbUszfJvPSWHJ2SxmNdBtmcMbqY/2zQBAPvF/i5XVzd3DCEM6jORDI1aCbxfwa0nP+JB5nvRhbyjPNyo0SAOaNc6zLhfVxgkAyOm/RHZeN9CpvZrhB/XNT0ggqMzx8LghpVq9ZP6FjFGrdQ+UpG3Smfr+azo07C9DxNmBXhzeIqXYJIrEc5sYl6W0b42jflgdLzkrTtiFMuV5qPklL974ajROXL8L18ghSIRfzcWUA7/yAsHbFtwapFY/UOuuwSwx5I97x4QATW6g== 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=dkpV+tQtXNR8gyNVTilzqm1GZllsQl7RH9cQf1JVoRg=; b=oZtBkMZt0pZ6NkiGuttYvy4jQDVlxfyRGb2XkzJpRPh9rlU+KAffeFdfqDZD8NIcuOs4X9cmHg/ADdmOCa/dQEufBxfK6on4cG94SQqKBhIJ9U2AeYgBGGkwDGXAlABi/19Y1CzchOBYilDxmnIsC2OWOy58iWgSsXolMAemiL4MROcJ9yESoVs6zNlgIuhlboIhjfYGd7DO+slt+uaUMm2ESBBR6kqi0z0O2Yd3j5zTzjzU4tn3fjsz1zK+/iTUMGEHT5eJuI8+T2TM1//RgSmz+2QObNy9lmiSRsciD7NSR0+LNLgdQ1XyGIQPDlumdhiUHJCk4NzOwmGgKk80Fw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) by SEZPR06MB5047.apcprd06.prod.outlook.com (2603:1096:101:44::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug 2024 07:36:10 +0000 Received: from TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318]) by TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318%4]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 07:36:10 +0000 From: zhangxirui To: Robert Richter , Ulf Hansson , Jaehoon Chung , Nicolas Pitre , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Adrian Hunter , Taichi Sugaya , Takao Orito , Michal Simek , zhangxirui , Linus Walleij , Bastien Curutchet , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 8/9] mmc: sdhci-of-arasan: Use devm_clk_get_enabled() helpers Date: Tue, 27 Aug 2024 01:48:46 -0600 Message-Id: <20240827074857.2671808-9-xirui.zhang@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827074857.2671808-1-xirui.zhang@vivo.com> References: <20240827074857.2671808-1-xirui.zhang@vivo.com> X-ClientProxiedBy: SG2PR02CA0005.apcprd02.prod.outlook.com (2603:1096:3:17::17) To TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5178:EE_|SEZPR06MB5047:EE_ X-MS-Office365-Filtering-Correlation-Id: df44ea22-f394-4d05-08e9-08dcc66aeb65 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|7416014|376014|366016|1800799024|38350700014|921020|43062017; X-Microsoft-Antispam-Message-Info: kQrkkQHv3ZRyxPzgeYbGwT0Wf37h0jZjYWt0Uck6g6+QM/zjKFBluRugDyn0CBwtQzhWVTTuGHLGl7Hr6WQ4siJvcj8yNWwbzhThyCj85JULyk8KzdH/onmVU0GnG1EQIK983PL3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WV9SsZjljOCVBD66LJfFYV3EX0MGt8+uOu9wNzitTwetkrFXI1/vMXYYBplHEGrh+ja5TKSqfe7+ri9NYWAAHXnaaS+n7QhHn1YFK/PA5lIx85T6Bfpq7kQjbt4rCCl2hfJ2KN80LSBPwSMNjtI+s42nkM9rRoK/SCmnWHrT06nlyBdMol3aBuv8I48tN2q0V6i9h5puhkqTsyCEDmiKZ7HGivNlb5WtBMWudB97+XFaCaHgVertP8dlBsDe7Zj X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB5178.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(7416014)(376014)(366016)(1800799024)(38350700014)(921020)(43062017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: myqEywk4BAfqwat1OpodiWImG8pdfv2TbLEgaph6KFUwgdwR7KIBgpFZ9x6hBG9FEJyYfxqGS2RBJ6nDkFQ4wG59EUsESzvCiGF4figqsXhCWp9p1ec9S1TCtztFfHb1LBWQUlM6RlUFLy1yuxFY6R9c01hfh0ot6tPEFUdF466fuirwiVVBBkey1KH1L7sGBEU5d9Kzh9ej8E+yJDE33B/3oaVjozmK6aGlLh44KK7kNPqT1yRKtkZEg+g2o/PjS2bflhRn/2/KFqqyzTTVl3jp6c0k/2P6Tc5wK1I5ATMB7hwMB21rB6KSpZ7+mNVv9vgJkZKvfgi4QRCaFbWHDbKrh4il31Y1VgO/usDfKLeXv8i4xe2hfConHIrcEWeypmSDtZ3VCiL3SAgShGoWa0kWCBSDeh7rcedbDlP8KsSRb9XK5QERRsrLhAjcAMwx2Gb0QkkCyD9kUJoeBsWMHUD2Ozv9BDRySNIVzvH6DjXV0xNeZdZsEvGQ6nnfmqZvFibiM8P6mwyZSc4ubGMId7Cu+5EFhfl1JM7TCHq5R66nvjInp8ntngfnVspQCfycCRu/g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dcc66aeb65 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5178.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 07:36:09.9260 (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: sTmXG1uR/7XivDhrJhav2H7ULPqwH70XcvorQqbqIDWREF1sVNml873rCYOHFEb6QEUMahkbmBlD/0U2qMcw0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5047 Use devm_clk_get_enabled() to simplify code and avoids the calls to clk_disable_unprepare(). Signed-off-by: zhangxirui --- drivers/mmc/host/sdhci-of-arasan.c | 31 +++++------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 5edd024347bd..f6458804ea0f 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -1875,45 +1875,33 @@ static int sdhci_arasan_probe(struct platform_device *pdev) sdhci_get_of_property(pdev); - sdhci_arasan->clk_ahb = devm_clk_get(dev, "clk_ahb"); + sdhci_arasan->clk_ahb = devm_clk_get_enabled(dev, "clk_ahb"); if (IS_ERR(sdhci_arasan->clk_ahb)) { ret = dev_err_probe(dev, PTR_ERR(sdhci_arasan->clk_ahb), "clk_ahb clock not found.\n"); goto err_pltfm_free; } - clk_xin = devm_clk_get(dev, "clk_xin"); + clk_xin = devm_clk_get_enabled(dev, "clk_xin"); if (IS_ERR(clk_xin)) { ret = dev_err_probe(dev, PTR_ERR(clk_xin), "clk_xin clock not found.\n"); goto err_pltfm_free; } - ret = clk_prepare_enable(sdhci_arasan->clk_ahb); - if (ret) { - dev_err(dev, "Unable to enable AHB clock.\n"); - goto err_pltfm_free; - } - /* If clock-frequency property is set, use the provided value */ if (pltfm_host->clock && pltfm_host->clock != clk_get_rate(clk_xin)) { ret = clk_set_rate(clk_xin, pltfm_host->clock); if (ret) { dev_err(&pdev->dev, "Failed to set SD clock rate\n"); - goto clk_dis_ahb; + goto err_pltfm_free; } } - ret = clk_prepare_enable(clk_xin); - if (ret) { - dev_err(dev, "Unable to enable SD clock.\n"); - goto clk_dis_ahb; - } - clk_dll = devm_clk_get_optional_enabled(dev, "gate"); if (IS_ERR(clk_dll)) { ret = dev_err_probe(dev, PTR_ERR(clk_dll), "failed to get dll clk\n"); - goto clk_disable_all; + goto err_pltfm_free; } if (of_property_read_bool(np, "xlnx,fails-without-test-cd")) @@ -1940,7 +1928,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev) ret = sdhci_arasan_register_sdclk(sdhci_arasan, clk_xin, dev); if (ret) - goto clk_disable_all; + goto err_pltfm_free; if (of_device_is_compatible(np, "xlnx,zynqmp-8.9a")) { host->mmc_host_ops.execute_tuning = @@ -2007,10 +1995,6 @@ static int sdhci_arasan_probe(struct platform_device *pdev) phy_exit(sdhci_arasan->phy); unreg_clk: sdhci_arasan_unregister_sdclk(dev); -clk_disable_all: - clk_disable_unprepare(clk_xin); -clk_dis_ahb: - clk_disable_unprepare(sdhci_arasan->clk_ahb); err_pltfm_free: sdhci_pltfm_free(pdev); return ret; @@ -2021,8 +2005,6 @@ static void sdhci_arasan_remove(struct platform_device *pdev) struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host); - struct clk *clk_ahb = sdhci_arasan->clk_ahb; - struct clk *clk_xin = pltfm_host->clk; if (!IS_ERR(sdhci_arasan->phy)) { if (sdhci_arasan->is_phy_on) @@ -2033,9 +2015,6 @@ static void sdhci_arasan_remove(struct platform_device *pdev) sdhci_arasan_unregister_sdclk(&pdev->dev); sdhci_pltfm_remove(pdev); - - clk_disable_unprepare(clk_xin); - clk_disable_unprepare(clk_ahb); } static struct platform_driver sdhci_arasan_driver = { From patchwork Tue Aug 27 07:48:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangxirui X-Patchwork-Id: 823375 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2071.outbound.protection.outlook.com [40.107.255.71]) (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 6F14F176FD3; Tue, 27 Aug 2024 07:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744189; cv=fail; b=RtwG/ul2dT2jlETdPZDdKOGsCr6RpsFNsaThaWiklzruTphOlwc2TKAk3K85l+Lx91Fh01XiEg/RlunHNxlOwuSFpTlhceVlu0scUVaIbEdEsG7I7HhXeYpuYTwnRm2bo4+YAXaI65vetP2PdUSREVZ0LadUyvr0sjlurVO2ZO0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724744189; c=relaxed/simple; bh=ctxVaJ7p1II2FYJ/Tfd0zeaFEiFvZ3twZzpUG45S6u8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=R2Rtn7GCwNHeAUrWH50ZQEA/pn1Ohmd1T9Nlbvks05SVbZAu0FGFvNKRjo7AyZqHr+3c7UsKga1HsRV/3Wtt/L1/GLIn9M2If6z+Mm93qjdTA+ygrF8mXcOqjPVFXHdiWAhd+ZtGy6KlB3i7qA3sv3VQvdSul0dyZoQH0iN8oJk= 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=dgigVOSe; arc=fail smtp.client-ip=40.107.255.71 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="dgigVOSe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=atNW5LZhKGH0XBzM9JQ4BVvMQSCSWRZOqNv3sWX6ejKGlpPOkDoTyGRtk9Xj/zA6s9QDhP0H7SilmzomdRRHejYV4pkum+rUUnH3eIazSKJvXW7amAvkv1+7NJ3Us7Yn727jzyOcdtNH+H5gosV7L0BDUn875h9fHK6FlU9uJCsO4D7R1xmp5hNuuVdVfSCCEUItndRwKcplSBfKvMr6QOLRSKpd/FgQqJZa6sUfOHlE8j3weWmOzqwFCv+mO6R229rqBx3mKnkw8+z9IsOUnEAeMMGxKC5SM0WMNcAaFTdv4HRC6z/ej1ed2eEXOsbZq3ZPiq/n1MV8/al9sheaYg== 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=RQeZ1C+yLysxsMh7x+D1RHqd/VgZh1AfNgeP17PvPZg=; b=Ekb4cUk77LujdmKw1sJkCu0nu3bc3hR1wGHSswAGVMoS/ZYDfLvCVHpRdzpNg27sN3PKt+LHj2b0zRtMwpF4kCte6qonh3CNEOO6ecHunfFY4u885YYNqiYYHFeeXSpKr+FSVYqBl3jZPlDKgArKkQJtJGh5eXxVkCk0RE7yhuxszaUpBSEdz0+LPjxe8xfc7S9YYTf5NaICJqShj7QwlNaAPDJmvBc6styEiPKbCFh7CEjNSMq4iYTMszv8GCJ0SJ4ZE1kq0fJNiz9Gn3DH6vo1t0ByLRP/wBjkDzaB7x/fM7vaGbS7b0UmBWPGhWOq1iJpgIw1JsLcTnsmLX+i5g== 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=RQeZ1C+yLysxsMh7x+D1RHqd/VgZh1AfNgeP17PvPZg=; b=dgigVOSeMmLT8Ta6WwuhaMDAOnOUQ3DHQUA42osT69RVGfWiuZbTtk34U3T/xp9AANkq8PG4GwjagJEYRv8H2+NOSI5T3iQ6NxrfeglkXdV64OOuv5jDIGlOoLAi9xA/Ej7pJmTCWsHAFFENgDuKj6g8QZCFmPaRx09r2pxkcFIlm9JKmBJkR89wc5krqhfPKU72jrEv+7V+OXLMnyOEZZIKqRQSIQlxzNoCcd7yAm3BxRIZpF8aZCMpQAbCXoyZnlZ9+XxefnSqewihWRoXED/GZEGKq1DPGSwqVuLFJARSdyX3g8xITh3wBn1/sVth5OWm/z4ZFTMsWsEj4GUdEw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) by JH0PR06MB6656.apcprd06.prod.outlook.com (2603:1096:990:2f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.22; Tue, 27 Aug 2024 07:36:23 +0000 Received: from TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318]) by TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::f6de:c016:c33a:318%4]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 07:36:22 +0000 From: zhangxirui To: Robert Richter , Ulf Hansson , Jaehoon Chung , Nicolas Pitre , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Adrian Hunter , Taichi Sugaya , Takao Orito , Michal Simek , zhangxirui , Linus Walleij , Bastien Curutchet , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 9/9] mmc: sdhci_f_sdh30: Use devm_clk_get_enabled() helpers Date: Tue, 27 Aug 2024 01:48:47 -0600 Message-Id: <20240827074857.2671808-10-xirui.zhang@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827074857.2671808-1-xirui.zhang@vivo.com> References: <20240827074857.2671808-1-xirui.zhang@vivo.com> X-ClientProxiedBy: SG2PR02CA0005.apcprd02.prod.outlook.com (2603:1096:3:17::17) To TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5178:EE_|JH0PR06MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: cdcaed42-2224-4c48-a1ea-08dcc66af31e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|7416014|921020|38350700014|43062017; X-Microsoft-Antispam-Message-Info: 5wMj7oCHHOF9tL8iXSALqHvrq+o/vWj9cGy9AMNu/J2t/fzve+BPf8HF0wqTJnunlU9qao7OIejbqJLRQJ06ZiBlow5Ind57U8uw4zdNJLZd1tE4ZYQC+Wz6YcUxUVmbNDBo0J6zQ8mvxEQyjnWCuw9vk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PCniFzJFHEGjpwOehPt71gWEk16d1vaR2kVjumBJtdZWga5d2Z+Qh40OBjFv/YpEtgA440YT+kwzIhhlo99B1GeeRQmqTqH+iejUtGGUL+WThn74XQS02w2gxLrw+hxSy5a9N1fW2NLLxYfAerU4xZiVQtHMi4WVKXdsqI4XE2fqP/ZXgkVqTs18xBH+6moo8cd01yZqW9BLGNFA7V7O6bfCyzXibVz+oCpij8Uv4/JaCw64BlLOUfhXsz X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB5178.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014)(43062017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XmrGRsB+UfrTxO9TU9O3KVsIWzr15gKha3qUFY6maXWJq5pkgAX3lTX/KCTHoT8KbsB/8YuNq7yUJXhHyJ+moDklTktINtjLlTdHaiwQVIVmSEcDndmIOivcjgcI0M/N5DEp3G9zbQ1Iju/QmB2ThlqDy8winc9Vf2Sr3f7yEt6PCW1uiF+DTpXQew6aO2YeowUP6tatI0WP5F79iJvsL5SvhDSgY0d+WUkxecTnyuKkshcjezDFtSatNYxDmmFWItdj0nJIcFLdzdEaN4b33VDG5H3L+LK1/mh66KkXujKDxn2e7ggKP4mnb9k9U5ka/6qBAelJrVxkL6DMvIb7ejZ/+ELvEJQd1N79XzPPzml8SVF8hYvdj/kA9dQpI+9BNs9uSH/+WmJdGBqqOH8VYnu2kru2XIOCtjDEcbLPrpAVT8JYFNXwfp0NEXk2ohoAUkl3ChMx4Jk2Qhf8IVoc+HajjYCXYQFi0E/uy9jPgmCFm1ZBbve05u5HfZragrXlB4e3U4LKDEU2d1S2S+a8Shy6ruxb4RCpliKjgwl6matLESNmtVKOy5DJ855tpWg+3yO6ol9k75ETL81H55HAreW09Maq78dEEowjdinybwUDLPh2Adjo3vMY99elC6L8jElN/7lA8GMBPAcxhOZXp2od9Ov/URtdBBRtjp7MFrEH1sn5m5l29CbORsdRpekAUY8jyNhGzW06VlOeKeGsj8/iFW9GlUVWWadFLH/Lwktg4rmKTz8fPWHEb+ZnIf8YuXcQ2gRoyQwceKQwTz6u2Qr5xyEOqrleEbLLcwyUTeGAKUL8zPCCxQWjVZqmRAMS055/AF4oqhVXeRObgn9EsuqQrBoQsh4m4ZVzUM5ZwpWiAUae2CDOtteU0Ohldi86Q5KeeFISDeuYxYgop1EPMxgtU8dFOlQtMeZQ0Rls4agFWDzU10X7HCH8ZK2HvKFQgQOyI1UuIkAzb9tRHfc1PkUxeCRVa0+R5SReFHnLloQPJmsx4tbfQY5MRdG7+jZsu3pESvgePIGfWGlvgKvMkq+ce7GhVZnVMGIHCB7d/Pmq1dHV17sCl75anFnv8DtE7+NKX4P340sVw2c2tQQxwBCARj0eTaSdjMVAfrDF0pm1RWCc7z9UFLcCL3UVAGie2uChCSyICnU9JxJxUq/lZFr+e5L5JAyagf1RLDVlni4ZAuqnKVk6v9MogP93l+pgt6vAAErC1/w80OE8UlOHHNnAb8jnVFoO+rXdwE89p90D68p3voh4C2LJWxk8Zuz0On4fyDbyru2M3pGnSDsivr4wK75yv52WKhod39/oyWsrY3JPH/UepR8Z9UMHS/gc45gQvw2yOt3z9wio+pMkhiJaZcidvgphrWuXyN8K0vEJqVkKpQXBAYLSV/UY8GtxPqT97+HtACvIi9hPRiwoQCIMbet8Ne2Fjpia4+H9kpKqURRx/ctrTRixuW2fyhkwPui+E+eqNlQF69XQmAbQUSMXh57Zr9i00GdGkvy8QARmiAOrRvOPpkA9l8cadTVDFrnmNxcBgam5Nwd57060D5OfyxK7+LPqWwI1uWGIst/iVoxCXjCQtBPfVOSu/B2g X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdcaed42-2224-4c48-a1ea-08dcc66af31e X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5178.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 07:36:22.9153 (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: ZsQCaY1obd8Sz/y/rCptG+WfiZ3WROfYzzt/rRE/V4MElNhQnaLevGJY55pqU8F4tnHjUVtNtiv1XXqcoSp2ig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6656 Use devm_clk_get_enabled() to simplify code and avoids the calls to clk_disable_unprepare(). Signed-off-by: zhangxirui --- drivers/mmc/host/sdhci_f_sdh30.c | 36 +++++++++----------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c index c58e7cb1e2a7..ba49c5d70ca6 100644 --- a/drivers/mmc/host/sdhci_f_sdh30.c +++ b/drivers/mmc/host/sdhci_f_sdh30.c @@ -21,8 +21,6 @@ #include "sdhci_f_sdh30.h" struct f_sdhost_priv { - struct clk *clk_iface; - struct clk *clk; struct reset_control *rst; u32 vendor_hs200; struct device *dev; @@ -118,6 +116,8 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev) struct f_sdhost_priv *priv; struct sdhci_pltfm_host *pltfm_host; u32 reg = 0; + struct clk *clk_iface; + struct clk *clk; host = sdhci_pltfm_init(pdev, &sdhci_f_sdh30_pltfm_data, sizeof(struct f_sdhost_priv)); @@ -138,35 +138,27 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev) if (dev_of_node(dev)) { sdhci_get_of_property(pdev); - priv->clk_iface = devm_clk_get(&pdev->dev, "iface"); - if (IS_ERR(priv->clk_iface)) { - ret = PTR_ERR(priv->clk_iface); + clk_iface = devm_clk_get_enabled(&pdev->dev, "iface"); + if (IS_ERR(clk_iface)) { + ret = PTR_ERR(clk_iface); goto err; } - ret = clk_prepare_enable(priv->clk_iface); - if (ret) + clk = devm_clk_get_enabled(&pdev->dev, "core"); + if (IS_ERR(clk)) { + ret = PTR_ERR(clk); goto err; - - priv->clk = devm_clk_get(&pdev->dev, "core"); - if (IS_ERR(priv->clk)) { - ret = PTR_ERR(priv->clk); - goto err_clk; } - ret = clk_prepare_enable(priv->clk); - if (ret) - goto err_clk; - priv->rst = devm_reset_control_get_optional_shared(dev, NULL); if (IS_ERR(priv->rst)) { ret = PTR_ERR(priv->rst); - goto err_rst; + goto err; } ret = reset_control_deassert(priv->rst); if (ret) - goto err_rst; + goto err; } /* init vendor specific regs */ @@ -196,10 +188,6 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev) err_add_host: reset_control_assert(priv->rst); -err_rst: - clk_disable_unprepare(priv->clk); -err_clk: - clk_disable_unprepare(priv->clk_iface); err: sdhci_pltfm_free(pdev); @@ -210,15 +198,11 @@ static void sdhci_f_sdh30_remove(struct platform_device *pdev) { struct sdhci_host *host = platform_get_drvdata(pdev); struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host); - struct clk *clk_iface = priv->clk_iface; struct reset_control *rst = priv->rst; - struct clk *clk = priv->clk; sdhci_pltfm_remove(pdev); reset_control_assert(rst); - clk_disable_unprepare(clk); - clk_disable_unprepare(clk_iface); } #ifdef CONFIG_OF