From patchwork Fri Aug 30 09:41:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13784817 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2058.outbound.protection.outlook.com [40.107.255.58]) (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 5F50B176FA7 for ; Fri, 30 Aug 2024 09:41:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010898; cv=fail; b=Tt777O9O4kqNDNMEjv/HGX+ZKy3Q60b0vGQLMQqoDjvQD46gbgClYOSHbw4e5DWaehME1WxIo7mXUfFP8oWPbF91E5gd+YYX1XPb+AqBccRa8gGtczi1tbL2mSqcLYReJmZOh2tLUYSQzJ2piObbnyEhs3Y+mFWQXRR5ob1uIQQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010898; c=relaxed/simple; bh=GvIc++rqEwozamJgPgjPeSpylRLRXAcXLbai12DeWFM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=tt7Dt3vaSvIgpoXte2FlZ2tpHdEM+m2bCAsEypEAnJwt+QtG9MkREVTbsI+yid2iEryBWRybgL4yXA/HfafweMzKsdkWJ621vR+VWIbi1xOEDYYgKjisA/rKdS/JkaKIJVbmLNLJiFZCR63p9LVYOGDsEF+Cs3k+O0vYB+6XcUY= 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=kakSq0N/; arc=fail smtp.client-ip=40.107.255.58 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="kakSq0N/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q01dL9eW7sR1g3CETuiOvOck94kfITUN6iucNnG5vWGCdGgsR/i+iMFcHVsCLZz6SxPAoXtMt3n503ay5Q5YI5DIbTYUHzPzXDgg1X4K2ufcUWSievCXYbRZOPgOaQJy2GTpfAZacStOHngWWRc3fZbbXLwq6YH67QS7LH/i2yB3M/J1g3Vb7yE2Gd70CYNymLsJj+FVY3xvIDYsb1lCp6ac1iEHVBwBdTAFSYo/AcCwxnDaENLG6BTv2Yj4CQa5AJUt8tGc1fAZtgkyHqvWelSTU+k3I/jR4HsQWm1WA08i1eG1q59wElxbLyFEk/dA0mQFow/9ip9roGy4JMqmqg== 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=VMD1tFMtbjg7clIkuF6//6Le86g++J4t/EXP2XF7roI=; b=SAsOjIthhKjSbPiwH/0M/CNBcDUFrVCtvRHnENsy3e7xc1tXU0p8PXN299BlLJapCgfyJ9NHOjsxrsUABcDgYslMD/NDTnci81rJvvE6/SfnMwBam2J8MRgktS/BkceH1S7uKH1zXut8l6eV72fXnqmZfYlI+tYA9M/XaORflWlNWiaPlyKHrSh5v/jV3LCE5zOZEuf6ufiBSFOmHinb0tsAa/+WbtxET/fn6ny0MuBAzhO1I1jE7S/5D68nOaIMll5nzXA44iTl0U7ztmFl4Y8NkALxT/iiXZpa835ls4WzxeZvzDmyuVkvnfaZCeX61rhE9ZTHMXiEQ3FAgKZqmw== 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=VMD1tFMtbjg7clIkuF6//6Le86g++J4t/EXP2XF7roI=; b=kakSq0N/XhmMbzbgmJj9CgyvSzsSU8rnPWKRwkX3tHgyelvWrMCT8tmeDGrEs/1aqMnt6XY4MDmb/Au468m35PxFWOTjQUyypSacyS2pt5rnWgkPdQYJEYHduXVEnLHRh+/s7gCN6NTEd3lLDIiLURzoTwIuKW+qmZrtetJt/wWa59XlOuDqgWov1Tnnu0jl3VRcxb2+VKHZA7Cu6fb1Ro+5NSJA/zsFZSrsCDCJoAU9BuzeaVhDT1LcSHWKty9zdl6F/R5Qv85ug3KLKIsMiQdGqbLnfW9SEiaxTNCl4YfSfj4cnf/fpLSX2EGww6boBDt3YKOBPzuNWapNZ0rNJQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) by TYZPR06MB5203.apcprd06.prod.outlook.com (2603:1096:400:1f9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Fri, 30 Aug 2024 09:41:34 +0000 Received: from SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6]) by SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6%4]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 09:41:34 +0000 From: Liao Yuanhong To: vkoul@kernel.org Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Liao Yuanhong Subject: [PATCH v2 1/7] dmaengine:Add COMPILE_TEST for easy testing Date: Fri, 30 Aug 2024 17:41:12 +0800 Message-Id: <20240830094118.15458-2-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240830094118.15458-1-liaoyuanhong@vivo.com> References: <20240830094118.15458-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: SG2P153CA0020.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::7) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|TYZPR06MB5203:EE_ X-MS-Office365-Filtering-Correlation-Id: a3cbb205-0a9d-4226-d357-08dcc8d7ef7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: rTLww4l/8YwNk+AkGkn5ZcDf1eY92y/nT0IlQysewdbZGMBdjEWhCmr8O1NkwQnWtAcM5ne2geNPPnnCS4kJrHxPrfOyPIBGghAIigJ7v0sWX/h6x1FIqevg7HvHphAFV1DxGcqDp3lQ5XOYf02GZLQsSbsaMFVcmGU1n0DX3V68Hl25CTKCeQxkuov2vOT9/+kubxE82sbLzZEU8mcXnLa/fJYgecvGK4FofJoPutlgwIOSSPDFCjfJpwzQje2FATTk9OS+cFHfxN0oWdrYyk8XeFh2YpnU2pFOVo6dpTFPGw+xaUhiDnTjME4jerdso2zsDElHJk3UiAeTNwPQvVlYlJexvvtznPfv1Ucu+wCFQJb69uiUcxzp0RvndwkkHn7QPzk/Oq85XMPI3rzfInbUSclr6HWKZJFVXqsELlkrH79AvGUYLXoeWlA2WYh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prd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2MW/S8MERK5FgtKtuNRlwWRb6SS5NVurcJUVZ8y5O02Cap01AHv0SQNoWLQtDWx5UxzdVeXSvTyz/mOD248M98iDb4A2OdK2Z2YJ6lG6/TY3szIZ4RL7gg6Ru6wpE5nDP4eCgDv+yru0B+YkMAzNCLsAtgAKUYyVL28ZtIMMtZohXcvpYdvQkbLZ5eE95u9htYa0gfPe1btg8PuIhdMahB47CPRILs9Lc0RGX0J5MxrI8CjHX+HLjO1K3sWbPAw4zTevt3NICMKqM0cMoLwUg8sdrBzj9JgjCd6Y3fYq4vTaXgexZCYkRrIo+DxheuGCRUuwN+poAmMpOSAgv1gJMyYMiGf23i91ZPOt+Dv2xwDqxJ9rntgNpZkeLBi+GhSxLyclesLhyqN9G+yZqH80/iNS4LpKI4dytH7KqeOLY+lu4m1d8lMUL6NA14p9oBBeD8RaFLHbug1bji9yiZrmE0ldZLY7/cvDxggsXS6kug8p9ZXKuKS30nXd7zPr8PARqwXKuS34w8K5f8/iDF9T8T+acpNaj0fBuw+1WYO85dftA2E/1KwZFZkMhl0wz4XOGMVYUqwQjtLaxHhH21CJx6YJjGKcUNlPSbXhB/b2K7Xpi+d3LD7JDyV05s1IICE2b4Fp8KMVTawgyKSborrC14glPhK4UDhqIT11oIztIgAKMrJyiOGMB2a+IayQoIpGxxUz0uj0lO+cqaX6NB+6lqHDJRX9b2x4i9/VjGD6mg25JEUwMiKBi7YvP2kB5x4FmkWDOvCe/4Oqpv5HEB24Uqeo1AcP6HdhGnRCep5NFX53VxnisflvQGRBT83uZnCNRDRq2Q9z1PUqYsMY0Y2tMc4689d/8Ar89ekus9Gn9lGGdiCOwIWowE9YUgU4LxACktFtAgjKPgH/h1rdx7IA2+crQ3rFjLAwlmHf4c0cLOktMJfJeQq3+adBxPwtsPJS1sta/Ul2flM1XqJwVDVn9YaRG5HSGhuSu2DXS1jPwuIQI9izLnR2UF9wGY4hYvo7kCVNcvj9bw9gpvgashIoURqJR7IG4i/SwLvy3Es70os4gqsDyFtjt2edUPPRt0S5bMBYx9ue4LzYNTwLkd1768ciRsDhOmg7sh0b5e3+9Qblkni5L2MA7xoHPm9OrTumH/KdbrrVYBMVVlHm90IcvXVQiU6RGzAyBFsPOljjmeB/FrG17eynwTyeCwaS54OcCMLT8pj6dxjanXTkevkvxpsMa1A2OUJsBn8QNnvAl2P4bILRlmXw2Cxsc+LC2uNIXY+C9AcRa3b6H5XLKoGh8Bw2mbCnWi+6LfRC47zzDT2LoQgB/0QTFb7/8BfzaK7JA1MBZ5yGfErMtK0VW7Cc59oXULbCGlq0jREwlmr81QLpFhkVPb93Hr/g8xRKq4UgJNGrB2uf/aOK4bp/ZU7pGhaZW9ayHK397wgcwoS8KHGoXnIvAnoE1+nlBj753nDtZZ0SEYRh8CoeiKaTzs9A6xwQnrl+jE2YRs5d/qOdRVPvBQLLRAAXwi/6owwzYfu96pEd2+Y/TmHhzweHsxn5y4NcHTbgrGtiFBGM6j5mQ13RiI1jKfwz+6ErORuHxq6k X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3cbb205-0a9d-4226-d357-08dcc8d7ef7f X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 09:41:34.3575 (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: w4/ToLR1fuKOKQ9sZYdS/9avJ1MvrkWkepljKNL/JmS6Lj6bnOijymTYX+QkU3rVgCNhNl7ViZBRi1HEwoc7nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5203 Add COMPILE_TEST configuration for at-hdmac, imx-dma, imx-sdma devices for easy debugging. Signed-off-by: Liao Yuanhong --- drivers/dma/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index cc0a62c34861..ca1ae677e0fa 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -95,7 +95,7 @@ config APPLE_ADMAC config AT_HDMAC tristate "Atmel AHB DMA support" - depends on ARCH_AT91 + depends on ARCH_AT91 || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help @@ -264,7 +264,7 @@ config IMG_MDC_DMA config IMX_DMA tristate "i.MX DMA support" - depends on ARCH_MXC + depends on ARCH_MXC || COMPILE_TEST select DMA_ENGINE help Support the i.MX DMA engine. This engine is integrated into @@ -272,7 +272,7 @@ config IMX_DMA config IMX_SDMA tristate "i.MX SDMA support" - depends on ARCH_MXC + depends on ARCH_MXC || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help From patchwork Fri Aug 30 09:41:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13784818 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2058.outbound.protection.outlook.com [40.107.255.58]) (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 2F69C17A918 for ; Fri, 30 Aug 2024 09:41:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010900; cv=fail; b=Mxm9GCcano82ZmDxCutl7BsoHirm/U1LoRXW+UNyBsCuJudQzeTCnaj7uv1x7EbI9U5pG2EEvX4p/2NQjdQh0IBvqnpsqfAvlUyrkCvyKub8yPPzs36fgV5NOPli/nDPjVoejeY4g3U+YRJL5YC+faej3U8hojw6tri6jAWL/P4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010900; c=relaxed/simple; bh=jfi+PYlezXIYdcXyXSsJ3qi3KooHAW9FCaDEaPD+Gls=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=DFyebT20mPENY18BdtLZ7pF9Y1g5ZHFvALdjZX5ypsx1zAfzNVO+TaX9f/SgNqGF2qNRENriR52mYzN4hUmeu/NZVs5r1Z7MDnqTLQ1ziGT/zhSxugCK+mIEz4rIhy06ZLJ9mChgPegubwAxLXpb2k4eTay1AI6mu001LZ48jNE= 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=nDl8bTys; arc=fail smtp.client-ip=40.107.255.58 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="nDl8bTys" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Vp5nH/1aBwoHZf2baCn9WQIe8Usx5WKXii/LOE91VHX6I1rPV2fw4SiUyzKuuhLXbV9q2iRfnkKQaDKcRI0H6DRWsRck/rTLw0kb07Ayg7VySChpnIF76kvduGIHIHEioP2vZruLU3XzYeYL+v/gyrBvddDqNAcGNWdorzZsI1uWjksNGl8fUFOoAlNzJn5Q7m7N3EWIh0skhVF1IXWyoWhHu4h6x1IcV3/W9HFsRdp2jx4gsAv+Jhgb5YiVOH+zT0IkqU6ktec8kUNMf6WC9tueeU3+HCGFElzyuMHTdHxUYESohDiARU0AfCR+5REisA8GchR9WM8ZFlDYnUkk3w== 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=Xs7ILw0SU9agNB/gUeCNtevHvf0OowZW0mDlK9ZWENI=; b=giwRc4IjJu5NrgSuIwkoRweyvOw64Rfl/Vv6V/YytwB62w1DvuvALiGV6/B/TjsxZQ1bX5b9TEQ/HeGawMLkyumHwlIczga56auHSEp2HlogK+1hVr7AOhZnHSvW/RmZ7DtAvkdrvQnWPgaVtUqhwLnj/MGVO5xIy7Km+fSxo08X70mWO5ckCje7otq2qR0X9mzACErSLWHyGKzDHiPmNNpRI6TzsKZDysRCHzC1kw1HdM7c+FilmSGHnD9MDCEKto9WxRC+FU7FYaAZ3oHhz+/7cn7c/H7Pwqo7ePaxPksOkOnCVCsWgtC8gNyW6hq7YsUXGoDbM/tGsPWisp3DLA== 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=Xs7ILw0SU9agNB/gUeCNtevHvf0OowZW0mDlK9ZWENI=; b=nDl8bTysnaroF+G2Z4B64cygNv1O44LUD6SXy98uDIvC9KizL8sTwlutOj7+Q4E+OIEQ/WNE/aygvlmMPO2GKESKowMnO6WedhLf5B28y68wIi9j7OI1EDFMdstsyPbXSZF+kIBuQa9+PhMRhSyVQMaugne4z46/KCnrcxtczjRhfHJ+APRhrPMx0NJqqPXwMunrp4wEZ+DT3NygEm7eg2o54+EOinSpi0IxDUSStpXutfsID7y/pG77RqfPwPFwoom3rFZIh40ntrFoU1kOH0W7tMBNChtNqtctOeL3CO0Et20A6oLiEURgV0+81kDioz/tjjHApVWsputgPV/k9g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) by TYZPR06MB5203.apcprd06.prod.outlook.com (2603:1096:400:1f9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Fri, 30 Aug 2024 09:41:37 +0000 Received: from SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6]) by SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6%4]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 09:41:37 +0000 From: Liao Yuanhong To: vkoul@kernel.org Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Liao Yuanhong Subject: [PATCH v2 2/7] dmaengine:at_hdmac:Use devm_clk_get_enabled() helpers Date: Fri, 30 Aug 2024 17:41:13 +0800 Message-Id: <20240830094118.15458-3-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240830094118.15458-1-liaoyuanhong@vivo.com> References: <20240830094118.15458-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: SG2P153CA0020.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::7) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|TYZPR06MB5203:EE_ X-MS-Office365-Filtering-Correlation-Id: 70b3775d-4135-40a8-ecb0-08dcc8d7f12f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: /fMZ/H4liln4i8WU6KPPL4MvtXgLwULoFsWE5fChkIq1Ou+ByZfiGY9FbKCyy8NujH5UerBCLpG9AfvrNQ9X+b1BhaHgBVWmiW77VhYd1gzAqZIOsdekRJwNYfmK2E2nMjrV/6Ce+SMJ5gBrv+x1hMz6m4r6yHKsZrc1oZ+BJrqeF2z5GsmEdtfC9u75LKUFQG1rCTY2cWKtUypkE9EefJrcbRGDlX5fIErJeQkSTBdMijHoaiLYxxVH4oY1cCreX3zxicNKZqE1xvbuPUqfwCoPAnmfY0zGW6Wnm4T43WcfQIA5MGhnEHAx+uWguQZ3DxmtmyPJdbdQ32r6EroYtI4HTriGJaw/O4HzSZFCLsiCDQfGiuIzlei+0AFyDvN+zRY/x4Y4iGum267s8Ga6F5srByZjSdBR2MFfnD5KfXxWurUwDY/nbMKt2fmuv7pxGtGxBbqNu2laio2SCFjOZINmUYtuAAWs5jMVDO58Sqj1RlxMtSQFB6Lm1VvT4Z1qoeOXanXab3ExVmJhTZntED0kJuwp3CgtNk/dA1u5rSCQWPPanBfxVgf9NoMdmboPKi/fSdFBF0FUyR0E/THjM2LgK9BS3Mr+jx/aO3BGI7JsNb0AUTv2iOvGYIk2g/J5I41Tk+yNP3MdWJmHsgWvq8JiQCN4c1JzsWPrsUXvWE4QHc+NKG+SsNzG/Aizhvpma2mlsIEu4tlEUL3IFRnXFz1u/Da/2OKmHPJa91Mwypu6sVIPb2qH05DQkOsHkNhRO2tFqh6yXE2wU9vAb8eSHV0NjS2M5prEAgFkFBHkxrIXDyJSnytK7pMz0qVkxPwu2RnHGyMIAyFSBrcP/TnNX6FQwLl6m0Q+raJA+Xv2vEUBBUo4kYlhfB+WDcM5qF3ZzdeBJZ+YyJcIry74SKkdwhs8/NOUumkWkL1E+HeepA8LBJsBbfGlwfJMoybgyMTLauBxH8dqJr+x5JM7bHzuyyIf7Vf1fmfwNuEe6/1wi5p0WFMUcMlBNC61HK1vveKIXjmIylCiQFELAHGTZxNEr5M7A7JCIEjb/2Tu7+QHQe/BuL2E7Ua5kAfhPMlZ7ut2uWQJKkph4PYXfRyIsG52Mlgn/om66lhChQksW5Efsldc5DqrCa+f65HOvSGASaD7eBqiRqW+JpzWUbXam+v6gu5E8UGOM/IfGxVbH3xhMziT8sQL+cQbxQlgdn3HakmYqKe0InNQNtROruUm0se6VuB+lFCTlKLmK5MRZ1s/2Mb5uKyvJcViV7CCD4n4uajjAK5P34BsAO3O46U7W4nGWoS8ClvK09bvQbf9bZz1F10q9P0EmxVWVSGjMU/Nq0cfLUsvjP4mGAkjb3KNxi8zhOcMImpnbQwwKU4SyqtBPMJs60zVy1kij8sFL9Nt6nPNAsdVC6OdZ59kwrrvadFRqQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5576.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dTdyAZosUHjMnsdEFb6i+8ApzamNBWH/bKY+buGF6xhIeMu5ykgnDJQ1maiWFWPhfGTSW0KMBxv6y0FFeACVRXXqN4foYNfAD9x4LBh8mqNC2SLjvavWtOdM2LcpjGH8D7VgRP3E+kD8N84JYRAzpMQyFjNt+BnXRhc1CD9wznz82kc0b4iAI7yP2eEETqggJdpEZDv/NxRLPN9E+vQEZV2BxSq/mpW36td0UVowbS3j6b1ZQIZkXfntP/W4NBmUr/83pPZej5OsvFvAPJksEbrhw7GNBMCvkOeHP0i6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GiHfpZ7xRZEBwmavEo9uH/tiZvPZ3/32tjvXcBI7UK2H/i7rCTpTPKE6K5qKx0RoiF+EmeAMgvrwPpSms8Tf9+63n49CXJD8Jv51ATyelkhlVEzyq4g/Fb8FmBDWwbZusIaeZnidej7xJsgJqQ15hHHK7qRwcs9tNMK1ac6ixTBJRH7DGeMlMzAKplv98LGRbxTX4pgYRQu/rFAOl28pVA+/15VrKCWe++5INmzJtSBuIDa8J5ZRE X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70b3775d-4135-40a8-ecb0-08dcc8d7f12f X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 09:41:37.1321 (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: itNxbKJ8YjB6J7XNXMBX4RLR76wvwjIQsJEUKOLkKTuLt8w2E+qJt+nieHy7CXOGNBkMD0nTw2U/Mm60Rf4sYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5203 Use devm_clk_get_enabled() instead of clk functions in at_hdmac. Signed-off-by: Liao Yuanhong --- v2:remove modifications related to the resume operation. --- drivers/dma/at_hdmac.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 40052d1bd0b5..2274aeb58271 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1975,20 +1975,16 @@ static int __init at_dma_probe(struct platform_device *pdev) atdma->dma_device.cap_mask = plat_dat->cap_mask; atdma->all_chan_mask = (1 << plat_dat->nr_channels) - 1; - atdma->clk = devm_clk_get(&pdev->dev, "dma_clk"); + atdma->clk = devm_clk_get_enabled(&pdev->dev, "dma_clk"); if (IS_ERR(atdma->clk)) return PTR_ERR(atdma->clk); - err = clk_prepare_enable(atdma->clk); - if (err) - return err; - /* force dma off, just in case */ at_dma_off(atdma); err = request_irq(irq, at_dma_interrupt, 0, "at_hdmac", atdma); if (err) - goto err_irq; + return err; platform_set_drvdata(pdev, atdma); @@ -2105,8 +2101,6 @@ static int __init at_dma_probe(struct platform_device *pdev) dma_pool_destroy(atdma->lli_pool); err_desc_pool_create: free_irq(platform_get_irq(pdev, 0), atdma); -err_irq: - clk_disable_unprepare(atdma->clk); return err; } @@ -2130,16 +2124,11 @@ static void at_dma_remove(struct platform_device *pdev) atc_disable_chan_irq(atdma, chan->chan_id); list_del(&chan->device_node); } - - clk_disable_unprepare(atdma->clk); } static void at_dma_shutdown(struct platform_device *pdev) { - struct at_dma *atdma = platform_get_drvdata(pdev); - at_dma_off(platform_get_drvdata(pdev)); - clk_disable_unprepare(atdma->clk); } static int at_dma_prepare(struct device *dev) @@ -2194,7 +2183,6 @@ static int at_dma_suspend_noirq(struct device *dev) /* disable DMA controller */ at_dma_off(atdma); - clk_disable_unprepare(atdma->clk); return 0; } From patchwork Fri Aug 30 09:41:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13784819 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2058.outbound.protection.outlook.com [40.107.255.58]) (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 EB65617A918 for ; Fri, 30 Aug 2024 09:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010902; cv=fail; b=VaYH/33YpN9lfEeYLEE+0SpkbhQLTOOa74wyc43T2BIzucve5HyLR+1xUpBHqY+g1L0xa7oGX9hYb5udp7KFBh98rDCIfqvKOcjc2SxWpWEaIq/zJlAAQVOfelQDIR4vbCnj7V6EzJX/ZVTEgUtbXuLXkTjCqEoXtZb/NCRZwrY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010902; c=relaxed/simple; bh=Qh7j9wmhX5g2OIvoFF7BzUrtY5MnqnRCX/Ycy2UFfJo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=GiAuNGD3uYqqNuP6wYGygRba7QdRkDMR5MzBgVcWm1TpYX1WTjVIovU9mOMGOH00CvN+frhXr7ta7coRqEA8dLkZ0ZFcmbhuZb+HvMbHmdm8WNSmcbvG8xPNbybPZW/9HdnP8+6hZeg/EhfnyS7OxeNdLpj3dKrSpCiH5JXaqQo= 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=pM5Q+5Of; arc=fail smtp.client-ip=40.107.255.58 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="pM5Q+5Of" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OD0HRwYPDa4EzguXEqEjtNmzCkDaJK4kXfcZDo6ryj9t1xlHhRT52D1nh1LfSyaTPoGMck2ExWJD8xGPxUVcrLgWa3A8dvm8E1iI6tGLZkOK4aAkBCgWq9lJTUlT4/TheMr60adWvrAtaLm+i7dv7a+MgLmi0gDUM1igVRVHZuLAX0CVFgpkoCxtxzjnpg1XP0g1B/+hIGnn8IZxId3qw4aoSzZwnllzZH9L9J5oaBrwZpPDU7JPKowQbvTuWOFhvC8+caC26abFc5sD23YpHveBwzth6z3CUkGteA0loa9fjH1acdiu1EHhkylVk/vh7OK+kCTk0ouFn+uikbW6gQ== 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=jSflPk0BFm/B9lDS+zKq7lNbv3OAyQZkdwzDG4lbNz8=; b=vAyN7CDlUK+/x0damW0hkpoLYU5sxnkmk2NPUTRKbog3pKo2hx28fhixrqdO7ANJP/l9RfgeMr1nmnrVJzcavMoeN06k6iKPNhgaTuVBh1RvXjjLgbTRAbOm6Ehqt7K7h5pWibUST7JKldTaZJXfCXIhlXHic+anPZ9ecEI7cZDDsW/vlCRdyxt8EtPTtRwShvw8Yw/wz5d6ppOyUkHIIEj5N06G+bTHDXwbmUgtj47u9fqarmj+uEwnieGS0MO0fkv+Ds34/NUDZs6y7dSKxi62UobEn/RHIm7TbaOtoPthk7X3Xd7VKtmNnuP344w6AOqrO1ZJTZIKSmcK0nRiNg== 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=jSflPk0BFm/B9lDS+zKq7lNbv3OAyQZkdwzDG4lbNz8=; b=pM5Q+5OfSDpkiNeRasec7Tdl26B0qGI075GhVEh06LsFXnHOupTL1XXt0WOJS1vFwlaLgRG7S7kGSGFZEBlzlJAP1vpitls0cBe9JSvPLLyEnM1jqL+aHfSwZvcST9w5LfexS1x+e9U+EDxeo0Z1uSap7/fs1E9tcC/ABTU7evQdxZTyKbFvuVj6c4kUabAuR14OduOT0SjExKoj6nOCFIHlYWTaDJquXRPYcplEB0h8E6iqnUBHLxDDzQ9zmPEqLNgrDoNv2o9rrSPTttrqiH6f5UtMA3VsT+K96pD4I3Z0QGmUl0Zl2IsDwzxkoE69TPyiJsN4QOx071A+rIMdBw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) by TYZPR06MB5203.apcprd06.prod.outlook.com (2603:1096:400:1f9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Fri, 30 Aug 2024 09:41:39 +0000 Received: from SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6]) by SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6%4]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 09:41:39 +0000 From: Liao Yuanhong To: vkoul@kernel.org Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Liao Yuanhong Subject: [PATCH v2 3/7] dmaengine:dma-jz4780:Use devm_clk_get_enabled() helpers Date: Fri, 30 Aug 2024 17:41:14 +0800 Message-Id: <20240830094118.15458-4-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240830094118.15458-1-liaoyuanhong@vivo.com> References: <20240830094118.15458-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: SG2P153CA0020.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::7) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|TYZPR06MB5203:EE_ X-MS-Office365-Filtering-Correlation-Id: 26d5a50e-d530-44e9-93bd-08dcc8d7f27c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: kmbDlkjnze4i4scuK5McV3Zh/AR0O45hr3HxGVaIKNpQn8vZ73khYI65TMeoyzUxDYpOimTUIoMgX9/FCvEl1XOgka9zthE8q/euZlH8ZanK2LPu1Am6wT1Wgh2Iafn/AODJ/Pbd+ul+HhdUfkSup4xZRu8Q5XVzNaMMIh2ptsT3XP9aAumJ1wfIU5lvVhy3e93FtDyVrBn+mv8FUa5kmsfFnVq/0ikqrfpZG0Wqjg0n83tAkKsLPw/y5Pr4I+lLU9IfUxXjHoXWhzijXmvSG69umlh36HeuptX+cXmbLz84qI26K20Vb4omW85ydwnMPMgdRapTMBs7NcqAy0F8654JKfuMsKHDx1FFGn4TBBfhixhTNlhnBOWO0CWzzeyafcziALIfUX8o150w/uz5OWi+qqp1s4VOpOXK0BC+Mq/F1k3pGj1XjsFropVwfxk51PXnuzQx2NAT0mq6KqwWMtj3nlMEMpIgrPoOy252MKUTNsLqj2wh18atPVQj7LZ0kijzMhgDUvOBU1WYBLJZ0legerk4kpwpDzu3s4mOy8PCidT3Ig9GV4Xl7eN4y/Bhj+PHbLNxg5GOJMOJiuLsnNX6fLMkYOH9vaZbH8Aw/zuB+/QriLCzDy/1MQ8+iGNrfuX2RWcoSnmpL5ISV0mEBuFOGahn7kMLfgx1F1sd8H7iySy4D6p+KaWx8fXzoE7lIk5sGYLtfYrCOHNqZj5bqr3EOZo2+q86b+pWqS9/9YeqFMOh7BusETasYOzynxAwB3/Nw3QFOkHBjWE1/le1c77Td9p3Th9vmaBZ4lpicFCGDxUf4mB6X5x6qMkl1XJPktQESDVh8uuHlONYbQr/gLETP+EWHo0rHuBG+ucrmu/u83/36DUCL+xhxLsqu/edn/rkYK+tNFfKxaC+99M5Ppog2FGhPXZ5dzC9iZpxRFd8RmohgJEP4Bj7SDSKncEPkEYyhMdCBzDQwg6Hp+uYoLBhgjMGaaI6yLUmgcYAH/JAI24TnuOBLmliaDALwKz+Tmmcr8vio5AVAUbYHyj13nCdCIkK/LtRg4p8NxeVtrEwfwVapJi8OZz9fyqEDEbJMwfSpknVb9rdgqGeVH9nIZACbRD2ed9bb50oAUFjGJipbGtGNUSLpBulvmHI/Bu1wFYDoEUsApAbGdD7AXFJ4q+naJunPSzSDZdOzqrAdlJmeGqb0Z9mNbxTziZdX0SQgvDYKlAjyJy32AzUuYGd6457xyndEES1Ds8X9ILyhxcQazY7uM37/iCkZpEnSlm4/ducgvCucFom/BsfjXlJX+9ICLo13NDwJxOr9hvPRObIBUmRZgtcMs4wXT/IpyStRdtufPg3OfTiA1PumP8pEaPavG0tZrOIUf0c25ME4pjwlCdD3x1oV+gY2RQWcEDYZiS92p2C9ZqFPwNY7xJ+uA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5576.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5DBK/pjBI6M5XI7/HAkUn9Qj1QVTelcPj3iTbHZfBqiWddrLxRDKfbn6KpaKPg2U3LUMwveqT9J/0k8/k30bOAhS5opM+syfpoDeq0pqQxelHfRG8+u4UaN8nmJs4AMR2RrY6aLzTz45dshRxczGhgiDLSN00KK8I3RJIb+4K7Ec4oJRiFKBkJolGQ3KakJD4/y2xtvLD4H1tcnzT0cnLzn2O6n/nwAMNht5+fglZjk95nRpRkXrR95Z77pPpma8WO/+hg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mfCV0nltHbx5upyBzatZ9YfH82j8Wjl0iM0QG47K5ZftcN/vdjunk5I7NJv2EHEfFK7q39ndJrnRpOGTYvypym7ZfsNKKVx/ZYqaEMmqP3ZbI0+dZ15HWvITbYY3jR+CX2IB2zS76BjuzJGmI6UpER5kFx0eSgD9tGNmuLqzz7MaqDM7MsEVGt51lgOx9QwdfjIPo7kbduAvOWa2WX0qpKYWSmgx0wWxnP9koOUMMHPnwm9RLsP0j3io7Fx89+jg X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26d5a50e-d530-44e9-93bd-08dcc8d7f27c X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 09:41:39.3339 (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: 7TuISufff5lBeq9ZVZIkTuHqmS38Q7RPgIP0CZ8Gcv+gL/ZzbeD8qqI6qOqEufhDkGOP8EBRGe0IQ7NTeBLTuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5203 Use devm_clk_get_enabled() instead of clk functions in dma-jz4780. Signed-off-by: Liao Yuanhong --- drivers/dma/dma-jz4780.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index c9cfa341db51..151a85516419 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -149,7 +149,6 @@ struct jz4780_dma_dev { struct dma_device dma_device; void __iomem *chn_base; void __iomem *ctrl_base; - struct clk *clk; unsigned int irq; const struct jz4780_dma_soc_data *soc_data; @@ -857,6 +856,7 @@ static int jz4780_dma_probe(struct platform_device *pdev) struct dma_device *dd; struct resource *res; int i, ret; + struct clk *clk; if (!dev->of_node) { dev_err(dev, "This driver must be probed from devicetree\n"); @@ -896,15 +896,13 @@ static int jz4780_dma_probe(struct platform_device *pdev) return -EINVAL; } - jzdma->clk = devm_clk_get(dev, NULL); - if (IS_ERR(jzdma->clk)) { + clk = devm_clk_get_enabled(dev, NULL); + if (IS_ERR(clk)) { dev_err(dev, "failed to get clock\n"); - ret = PTR_ERR(jzdma->clk); + ret = PTR_ERR(clk); return ret; } - clk_prepare_enable(jzdma->clk); - /* Property is optional, if it doesn't exist the value will remain 0. */ of_property_read_u32_index(dev->of_node, "ingenic,reserved-channels", 0, &jzdma->chan_reserved); @@ -972,7 +970,7 @@ static int jz4780_dma_probe(struct platform_device *pdev) ret = platform_get_irq(pdev, 0); if (ret < 0) - goto err_disable_clk; + return ret; jzdma->irq = ret; @@ -980,7 +978,7 @@ static int jz4780_dma_probe(struct platform_device *pdev) jzdma); if (ret) { dev_err(dev, "failed to request IRQ %u!\n", jzdma->irq); - goto err_disable_clk; + return ret; } ret = dmaenginem_async_device_register(dd); @@ -1002,9 +1000,6 @@ static int jz4780_dma_probe(struct platform_device *pdev) err_free_irq: free_irq(jzdma->irq, jzdma); - -err_disable_clk: - clk_disable_unprepare(jzdma->clk); return ret; } @@ -1015,7 +1010,6 @@ static void jz4780_dma_remove(struct platform_device *pdev) of_dma_controller_free(pdev->dev.of_node); - clk_disable_unprepare(jzdma->clk); free_irq(jzdma->irq, jzdma); for (i = 0; i < jzdma->soc_data->nb_channels; i++) From patchwork Fri Aug 30 09:41:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13784820 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2065.outbound.protection.outlook.com [40.107.255.65]) (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 0F7F417B513 for ; Fri, 30 Aug 2024 09:41:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010905; cv=fail; b=f/FXdW6vfGqHEuMzfVw1rpPvAxqkKcjlFCxAbHl0CcPJgPcdJjH3GfZsq/7f17qTmNg7INrc4EQoWCuAWBJqRXYWLNWoGvV7ZB4Iynf7QN/e3Kndz9XDiPKUarlYijq7V0akNcujt+MjrDl5n+x2FUtmC93Zg9BfLx9oeoG8q/k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010905; c=relaxed/simple; bh=V+6NdJrRhVgFyCqui7fB3ZxMdWS3o1zcbh9akWGQNrA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=b/8qJn6mGfGBb/W+jl3IgdQzfOHErFJbyAiBzkuQFKcFrOQMjfNZEJo/QpxXm8Ib7bX7XeWumzfvpxylaDDPxVlTylPl4iZFU0vURW3Qfc0kV6Ll9Vr8TcuJ+O+p0W/6EXO5qOibomdArw3PuIXfLim2aXGDHulWCtRQFl5MiU4= 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=LRBxGlET; arc=fail smtp.client-ip=40.107.255.65 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="LRBxGlET" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Zm8g3uisGLZZPKo4vyJ9oK5S8HhjFCvJt45hoXDA7GAFPz7C6PBSEIX8YiV2zH7OuXcvABTJSeN5rVGFtIi/JkRgTUH5ngOj8GdnTJyZvXGhiV2K6gis5IEDA+voZTwtRuf26JOJQv3PkhvKSjqb38/VGooitQesHXlHdwxteBQOH8aZNEjI5ycfB2W1GhsVuxxB26HBdidurOyr7q+M/DLlzKeKxpOd9Nsv+IhvrOFf8Tj6H3dAjr5YFTKtUnAXeQ4SbHOj4gebc8rz8e23YsUPMxEXPgW/KlHnW1F56WqM0keGmyIXVUM5RyBS+6h1FiWxgeLTxXdgvhjisHUonQ== 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=1rFj3XuP1UlJJULnvwfp5UgDisYMTdPSq/0iDlZKcEQ=; b=HRam8k3yWlOqIZKFHC6b/8NCZmkW9ur/00YIA5yVQ9ZmSev/KB3j9dUA5Tp1bRONFnREdHgK1z7H2MVsOs2PQq2qCE489VdUv8Iw3DJOKm9AVx2JCawV/T4R4JmhJn/e/w/443vypHNzhTBkR9HAHvbfHQgFSVJ8E8Ze9X0QaDJ2ywz4rAL8cCk7aRmn8+IQ0qkCEsY71g+pbgFYY84LexRpS7BhuT+onhMhJHUPDg2ocRskzm2/bADowzGHd7znA7xGadnnW3AnrHOTpdleICuw8KEdScaCqU665f2Svl51RkspWLOYXtMBfUQUPa9QPZMVTIRphr/xrg2PG9hYmA== 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=1rFj3XuP1UlJJULnvwfp5UgDisYMTdPSq/0iDlZKcEQ=; b=LRBxGlETJO9uQForKH2ybuI4OKnL6W/tCiVb5vGj10nDiG35nKugMiTZX/hNQh3U33QYGtFFvJFe9FCAq+ByR5lzXNEOnciNBmoBZrEmBaDTzI+mQJi1sXHan429O6CObr+r+5DDLE1i/TxUhG+ObXhCRWBtVVDeLHeJqaWJo2sNHbnQ5s1WfNjzNbt1Xk2Gk9wMSbpMkOABIQ3IMOLYLY8uD2Q1h3tidFVNayUeVEKHfXVzVhLMm/t6w9K8Q8ZPWo7HxD2sAjEi8FOnaZYJTIQdbaclijzYe4Qotx6awIxUteYOEX9qi6++Psd+cy+zuc54eaE0mcSY5y+dE1N9sw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) by TYZPR06MB5203.apcprd06.prod.outlook.com (2603:1096:400:1f9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Fri, 30 Aug 2024 09:41:41 +0000 Received: from SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6]) by SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6%4]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 09:41:41 +0000 From: Liao Yuanhong To: vkoul@kernel.org Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Liao Yuanhong Subject: [PATCH v2 4/7] dmaengine:imx-dma:Use devm_clk_get_enabled() helpers Date: Fri, 30 Aug 2024 17:41:15 +0800 Message-Id: <20240830094118.15458-5-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240830094118.15458-1-liaoyuanhong@vivo.com> References: <20240830094118.15458-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: SG2P153CA0020.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::7) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|TYZPR06MB5203:EE_ X-MS-Office365-Filtering-Correlation-Id: 181fbf1d-ff19-46ed-3390-08dcc8d7f3c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: NUjjj1UzqkNEE+IN49FDVoEDHHUcvTLagXBLSbdVGjOOE3kNk0WmzxAOWn/IgqwW+EZ/RqKN4IOjoHN3ftFMG3M4OHFB0G3Xcs8iRDScOE1wGWCspZLWPoOPSMxHsTFJGbqBbvzzlfCf0a75vmZq2a+vJdp0XK9ER6Cd/4LTTBiBLY/fmN/4g00wNLSIEuBtq1oDONslBfIXK7Izett07OzJ4metXXzMz4MynqrxkFAPYJfZv8AnQJijSk8UOKtlFzSRadZLRKB4+/gWpo8O8TlNKCgXQrvfIIbKpAmyTFJag9GukSO7dS3Z0XrfbZnSnuMets8ud9BWuO5DVXZIlnucGyEZXHkL1KCYL5dCEk3wsD1wfuHJ9YRz/9vhqszxsyzMIaOl1C7Dwx/CKzwx0UWODw2kWrqCHGSR2vTu4SmMwHS+Qz80qH0nsS+GUS3BQPSmA25fiJ5bBvsOA3SD5BTgvs0P8Si4LMquFep8orbXrsSC53pF92Rh6G9dQmOthiEunNxpNoIwvKdwH1XW/M0M02UdJEgYseQxUf82p+RKDe/dRL2XLdcV5huXV/0EK0C5T9DVjjT/ZEDWlAQIHEMYbP3vbQ2YXovGl/rm/H29mLeHzmNon3fEhB2I+4jCZ6dGAGQzeFpbKLMFoNtgGSeV4T2cBWpf+qZN4oEjMyISgWiS6oP/M/HA5hI0oWel9Rou2UkTd46wCj7eqnbKoZsUoUK5rRcmx1X9ZkJk+ERyCbteE8YzbI3RpAeVYVUeE2sGiEKVpdRnkjLhVQhSpnR9T65qDs/wG3pWmDKMNPOThYwnLYNbhycJ1YdD482RV9T9dExwnCI7lJpPBFiCPm0O5mQILGW7z8SaagD+2HYkySH7zxzHx7SFDMe5JKAHrn7Gz2B7bJWxfNkwVOdW91g/rCXFQw+SBbKy73c7r5jrauzXyNENtTuuVuVQye8r8AOcI2y/zDkv2vH47yW/M60DuBKfSJiSkwe30n2WmhBSp5q1RlpN5pNDSmjXM/K+xnbfb7NTC7KEkQpR1AWYzTQjkAVmbe/DkrYMOYOSmDRDmeS+g4LeL6yrIBB0eh/RYdu4M4kYzVNIf5/ioYnt7J1lTeR0h2mZHPAHxz5nxQY/m32Fcz1LH07Cg7dN0K/jc8s+97NfWMzyK+X1RV1nNvfNnKv0UdrVv4o/WlTyvTUPcYwnig7CdyN00i0QDckKOGkpgFiluhGFKYiNtNLECh3v3pXxcPqFcdQ8CsU/J4gopiV36uM24A1Xjb6vD2QVt5AjxPj3m8UWeTTdwyKX8r8wQ5qFZw3zDfEXB7PqFwcN5JLfcgD2KCHQLFN1OTTQOVI/cybctvkkqCkt7AXa0hhOCREPqgMO83nXQK90jmZOcJLygH9xrHPFfsh4jJTEctrneMP8I5FXJQLXV3fnFg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5576.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jo1qaIik9JtHEfyOl0Synr36zN5hb4pcvcm/xRKssyT+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ksmoTDpizcFMG5wfWT7lqPmWKk/xEA98+5xZxMClB8he5V6Rokjet3ysuRAvoEju6LDxCao9sJvgXzhoDAta1vkUlDPMQ5XLfPl94E7cyodstW60LoDnQBkhES7g2JB2tWtCwuW2SE6j853UZU1Iizke9n889DQVDUrPiWLLsWgL4efGANgWKVHgIXowuMIhzsV0gf4vncSopDvQfKHpXJyouzk2prZhVOy5stqUWZLls/65GbQTbpL7PTtzuaRS05+/7CWTO7siJ8WrltNPStmc3zI+c47v0kYKnaFzEZKr9IJu8QLt59H2GbMXcjueGUS/9ksT0GbAKJ4QWhn3sm8+32ll6FMhg4MLYCDIgZWSSqdDUTQSWutfTWYCqq+hwA0yXIK8ehas8YcOMF+nSCMcM/BNCbd1lCXcgBYlqPOrr0bppXkUZtA+7M1tbqlYY+w3kAN9ATuEbBcVn X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 181fbf1d-ff19-46ed-3390-08dcc8d7f3c7 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 09:41:41.4780 (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: HteSRIuwQVH7qF1DvglmrgRt/3sLw8l5RQBmy5KEXdDkRaIHhaDy+O3GGdN/IfU9FAgrBB3CBUZOjXeVDads8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5203 Use devm_clk_get_enabled() instead of clk functions in imx-dma. Signed-off-by: Liao Yuanhong Reviewed-by: Frank Li --- v2:use dev_err_probe() instead of warn msg and return value. --- drivers/dma/imx-dma.c | 59 +++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index ebf7c115d553..7178e9643102 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -1039,6 +1039,7 @@ static int __init imxdma_probe(struct platform_device *pdev) struct imxdma_engine *imxdma; int ret, i; int irq, irq_err; + struct clk *dma_ahb, *dma_ipg; imxdma = devm_kzalloc(&pdev->dev, sizeof(*imxdma), GFP_KERNEL); if (!imxdma) @@ -1055,20 +1056,13 @@ static int __init imxdma_probe(struct platform_device *pdev) if (irq < 0) return irq; - imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg"); - if (IS_ERR(imxdma->dma_ipg)) - return PTR_ERR(imxdma->dma_ipg); + dma_ipg = devm_clk_get_enabled(&pdev->dev, "ipg"); + if (IS_ERR(dma_ipg)) + return PTR_ERR(dma_ipg); - imxdma->dma_ahb = devm_clk_get(&pdev->dev, "ahb"); - if (IS_ERR(imxdma->dma_ahb)) - return PTR_ERR(imxdma->dma_ahb); - - ret = clk_prepare_enable(imxdma->dma_ipg); - if (ret) - return ret; - ret = clk_prepare_enable(imxdma->dma_ahb); - if (ret) - goto disable_dma_ipg_clk; + dma_ahb = devm_clk_get_enabled(&pdev->dev, "ahb"); + if (IS_ERR(dma_ahb)) + return PTR_ERR(dma_ahb); /* reset DMA module */ imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR); @@ -1076,24 +1070,22 @@ static int __init imxdma_probe(struct platform_device *pdev) if (is_imx1_dma(imxdma)) { ret = devm_request_irq(&pdev->dev, irq, dma_irq_handler, 0, "DMA", imxdma); - if (ret) { - dev_warn(imxdma->dev, "Can't register IRQ for DMA\n"); - goto disable_dma_ahb_clk; - } + if (ret) + return dev_err_probe(imxdma->dev, ret, "Can't register IRQ for DMA\n"); + imxdma->irq = irq; irq_err = platform_get_irq(pdev, 1); if (irq_err < 0) { ret = irq_err; - goto disable_dma_ahb_clk; + return ret; } ret = devm_request_irq(&pdev->dev, irq_err, imxdma_err_handler, 0, "DMA", imxdma); - if (ret) { - dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n"); - goto disable_dma_ahb_clk; - } + if (ret) + return dev_err_probe(imxdma->dev, ret, "Can't register ERRIRQ for DMA\n"); + imxdma->irq_err = irq_err; } @@ -1126,12 +1118,10 @@ static int __init imxdma_probe(struct platform_device *pdev) if (!is_imx1_dma(imxdma)) { ret = devm_request_irq(&pdev->dev, irq + i, dma_irq_handler, 0, "DMA", imxdma); - if (ret) { - dev_warn(imxdma->dev, "Can't register IRQ %d " - "for DMA channel %d\n", - irq + i, i); - goto disable_dma_ahb_clk; - } + if (ret) + return dev_err_probe(imxdma->dev, ret, + "Can't register IRQ %d for DMA channel %d\n", + irq + i, i); imxdmac->irq = irq + i; timer_setup(&imxdmac->watchdog, imxdma_watchdog, 0); @@ -1172,10 +1162,8 @@ static int __init imxdma_probe(struct platform_device *pdev) dma_set_max_seg_size(imxdma->dma_device.dev, 0xffffff); ret = dma_async_device_register(&imxdma->dma_device); - if (ret) { - dev_err(&pdev->dev, "unable to register\n"); - goto disable_dma_ahb_clk; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, "unable to register\n"); if (pdev->dev.of_node) { ret = of_dma_controller_register(pdev->dev.of_node, @@ -1190,10 +1178,6 @@ static int __init imxdma_probe(struct platform_device *pdev) err_of_dma_controller: dma_async_device_unregister(&imxdma->dma_device); -disable_dma_ahb_clk: - clk_disable_unprepare(imxdma->dma_ahb); -disable_dma_ipg_clk: - clk_disable_unprepare(imxdma->dma_ipg); return ret; } @@ -1226,9 +1210,6 @@ static void imxdma_remove(struct platform_device *pdev) if (pdev->dev.of_node) of_dma_controller_free(pdev->dev.of_node); - - clk_disable_unprepare(imxdma->dma_ipg); - clk_disable_unprepare(imxdma->dma_ahb); } static struct platform_driver imxdma_driver = { From patchwork Fri Aug 30 09:41:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13784821 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2065.outbound.protection.outlook.com [40.107.255.65]) (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 EE455175D27 for ; Fri, 30 Aug 2024 09:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010907; cv=fail; b=Kf07C3znyCpAIq5+s3CSAGIyCGVQtdd5MMl1i8cYHmD2KZqTEVNMNRVq4w4TxlJeJ2SPDDeph46j9yRu+FM4jPnvzpCDCeVWXyiKe8xXfytbqz+6iWjHEdhZORtyk5DNhEa4ct5uu3qRkPp9NJIBHW0JYqmtbMOOj1rB7MNRyOA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010907; c=relaxed/simple; bh=aUZ0Z3ianJXDx1xT9J25RFLohoDAnhiAthSlqVT654c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=lQ2RBM+iGUo4OT9jDFEt/nH83CgXgQ5QcpSylD4SqFXHotuNy3UqrgiSAQsvurx5E52LqZHFYsF9l9haIqM0BaloDas7OuHhCVJXOllIR6bpq/BZuzn6QzZmOsov5PHHk0omOVu6XP55YZ2Ws/EnSnyV8y7ujLhgXVmyt3PJQ3Y= 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=bkksAvBE; arc=fail smtp.client-ip=40.107.255.65 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="bkksAvBE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=M1IBMwc/nNWA2l8IkDk6tGQTwREqXajHWYT5SR/jEPTSu5Ka2mJl4WJsbmCjCKoID7RlL3gBP//YxIMmLvU/JI1XcyUjpYec3V7I/UKnQ768tU6Hzu0+QUbPUxWYu9VM9uLjOB2We+2ZilkhHPG/tTtYoxkdP4pRqepzoK3WydsLhth3WVw0hd/XnSZEBJHHuFa5jh1PxmMw0Z8QPpZxBKTuY5X4l/HfTYBRzqdmdBtopO0WPuNT53ha6T4gQZUsoXqqlnYohomcW2ZciWe1ll2cz2cQruXrp/h5/66Dm+7n030DdEhlWkw2kjpMFnjuEH68XRVL0It3PcOwfM2K7A== 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=P4zfr71ATHpl8x4CGvq5JmbNUkA7OrAKFkK1TBg1Ys4=; b=hvexd5XoMV1thPhiRiiN4d0xDQcS404Vpa2D6JVlprojuIyI6wdQMvSh9UpHZl2zsTBsUAtpSWIwUoYYzf6w+hlyTnpNKfHt90MdVDvfRzlSxWVmGVC87XkFDBPQ9vxYpQH+l/f0SMXpVh1CujZAdlruBcYvgK1fk3uQphVIsUQ8D/h0zbqdELseWzXzHS9W73d11adUkynqLUpIYXotMEozhiDeTEtfMqG0b6kp7M8sTJ1qXOnZfy1VCe+dQJOHm9p02pQxNSuDisxDzeantkpeDk+Ybubo0csvczRj4CtT7dPUQZ1/d/VtpmyhmyUNmMIQj6Hb19o3IIfSBIWdLA== 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=P4zfr71ATHpl8x4CGvq5JmbNUkA7OrAKFkK1TBg1Ys4=; b=bkksAvBE9v6lv0pPxXdBNXAUnSuhFee5XpPqt8oGVff1dhuzSFmgcAk37dcZ4Tsw5qIaDAywX8PqWyHloD2oM4R2NHeSvgpzD25nIkjaDkyGFMQ3J5KLwx1D3m1RlsttJ9It7jzPWoFqwTF0UNVo+ijKJiSnQRcMTvHKupz2Fp/kFvO1oJ3D5bB46sg2kXWAOyq/laU22FimSrFYRU206xgjC7zgFpe35vlvwlvtZHEH/52lui17KnT2zm00imLYZTrVeW1r0HmMSr8djz4ZZJLWiVZ+/kmrAKbVvvadyB/8FxSWCg4E3ro4ZDLuO/t+OUBpTMQ/i1FJAip1r1LioA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) by TYZPR06MB5203.apcprd06.prod.outlook.com (2603:1096:400:1f9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Fri, 30 Aug 2024 09:41:43 +0000 Received: from SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6]) by SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6%4]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 09:41:43 +0000 From: Liao Yuanhong To: vkoul@kernel.org Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Liao Yuanhong Subject: [PATCH v2 5/7] dmaengine:imx-sdma:Use devm_clk_get_prepared() helpers Date: Fri, 30 Aug 2024 17:41:16 +0800 Message-Id: <20240830094118.15458-6-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240830094118.15458-1-liaoyuanhong@vivo.com> References: <20240830094118.15458-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: SG2P153CA0020.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::7) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|TYZPR06MB5203:EE_ X-MS-Office365-Filtering-Correlation-Id: 63a66b08-fc85-4cc5-bdbe-08dcc8d7f507 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: 75XUrXbdkZyXDHcYrfJcr4SMg4A1C++RGrMBFXEPEEnQyYBggp/F0/d22lmCvTn5CkBdk85oJy7eA4mi51Th+XG2uN/0g/2Sv2irA0AO9jGQLIIX0a3eP4rVde/QXvsjMSyNCyktcNwl/KBCwwgZm5BcEMU4jCBMZi/O1Qf4TYVZBQ2Mybtg6bBGkvQXPj29b5NqsLr5oUBHRI4Ey8OVIjDVbjR6z+bbrNjjXovheAvOcC1jFmyX1n0VCdvqAMExgYHXygcEzEjDeo1mF2JMAKV+NfMvDfXUPtn49QjsI8p3zpPAqEVFLB8Dh2phmEEkSjn4LR9HeCxvbEE8mEk3gBXaFpAKNKoZ0YX+vC//rXliLWEXej1KnZiofYcgptWE20s7dArR4UBLAY7PCVeolk6kfnzo3AJFNG7Ye9hVKe+7fgyCWFJp96/TeymJf3sn7wY96nr/++N0DTNYKlO64JQh+nL/lODFS5sUG+5UXkqT1Av6p/IoxOr7YckWFpOKOQ0mo1/NndGEJDskKA7HU0AtAXt+c5ceWoIi5GQoT04GJSkF0zmb7146DG3r+PwQs4Oxd+ANy0/mwQ9IdKJnie01+gDGrDZVuBPnMhC375170OBkrlsqCFcHSnPBuZcCVBM7jaBIUhmEpA+3EJETe9ge0op0w7oy+iaoboVVIA8GI7qdM3vUBBVwI51TafqFx61r4pKgWcfZVDNe0wpCIHRVH/bx/SdZ935RksyROe+Fvj8MD6T5w/NkUmampZakV4dO9UniXiMC91Z0l8mIEQLPMJEFVgPbI5zyiKpE7axq6d6Ve05AC+pvtRAAfnpmcldQMrWaMVodGy3GPA5qfxt4uBInYxHN/6prJPP5s7uAwbZL3U7g3fO+2KdaWr+j17uGWJi+GnwzQNDxOqLizrt68guHw4WDS/66CfFupoOVWm+eypSufaDP88YowoluVSShKcSx3Dhihoh9inuAn6i2Xir+H/kLqnUsZIijNTYGL327y9fVMQ5lSYTuQ6dsc2io/e9OuvccmsLYYTOaITjtH5UlN8l936cgH7CEgZjWIZJOUW4/rQ9FpPNuTaWEcALvhjkba8aaSmSTHsDlOUMdoMIPha4nJXHAsTKZr159TgkaqAKp5sjPL7AMkbGuTK5W+YH/6O8ZhHESor5tIoIxqCRUYQT5j0OsHY5+EuOsjpGHqHIb1FamvFOwEEDmD8+7fN1nCoooysXE/6Ei19HN+dVM6sAUtXALKVT0oPPr9xFI7xiati+nAvhbYNyPTAJ41ooRKYO48uccN2Smt4Z/Kldmu/YjbFOjPSVPICEz338frWENUUUd0uZ/Gyu9jmDltdUZOFN8tAcGM3AdfWWAl4RBNW2IMt0poa9Hs7NdEOMIc6bt7HdXXEF2ceW9z4QduPnudWqeABWKAb93wQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5576.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-Ant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yWRU6qPx/92wo1EyrbInb6vuNRx5oNECuZuUm5lnnpUaj3yaeETaMxZ8YiQELBm3Lpv/ZbxokrYdw2TiYGrjUb3Dz6BTwrC6cyGUoriIwFSvs2+grhOUrTbvFEL1LH7wkSbs+KP7TiTUWgTAfiiZqkS9EpNL7s3j4jSku0f28xrKW/oKH0u0NrHQMaxOcjfqiuJGvACLn46tlUJ+LjCkvB12If+jEMQ5SJUGGfineecaWrwNmriAOLUC6xCpFK177Zm9V9rTDhAxfqPL/zfzKQ2JeWpV14Jwy2mvLJYnWa9bcypw39BBJETIQnCetvuYChIWvzL0rfNfhclSCPRQyw5AhF3/EHsddPe5Oh/AAH1fQdvj3rtagFnR+VGWm9ZbxlEBo70O6AMagBquerdBG13pKb/UrWovOKJTPjTfPiDH0kOvO9dzUfzdB0H1jpxs07t6Ev6MA/hYHSZma0ChkfW9AVOfX21br1QTVCW/B42WKnd6sZHKxc1PDURGe3orzdSHelMYKIM+hktSuuajWoRblOYr/0mQbbBsh76p9G+d X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63a66b08-fc85-4cc5-bdbe-08dcc8d7f507 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 09:41:43.5851 (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: Vr0XbRRIkgVE2iJ13fLu3BsjYv6I66AwweQhaVEtLWLVUL0EZm8R+Ir2omqgr7y9hlE8cwoM3EiJCkfIfCJVyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5203 Use devm_clk_get_prepared() instead of clk functions in imx-sdma. Signed-off-by: Liao Yuanhong Reviewed-by: Frank Li --- v2:remove all enable related modifications, replace clk_prepare() with devm_clk_get_prepared() --- drivers/dma/imx-sdma.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 72299a08af44..07a017c40a82 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -2266,33 +2266,25 @@ static int sdma_probe(struct platform_device *pdev) if (IS_ERR(sdma->regs)) return PTR_ERR(sdma->regs); - sdma->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); + sdma->clk_ipg = devm_clk_get_prepared(&pdev->dev, "ipg"); if (IS_ERR(sdma->clk_ipg)) return PTR_ERR(sdma->clk_ipg); - sdma->clk_ahb = devm_clk_get(&pdev->dev, "ahb"); + sdma->clk_ahb = devm_clk_get_prepared(&pdev->dev, "ahb"); if (IS_ERR(sdma->clk_ahb)) return PTR_ERR(sdma->clk_ahb); - ret = clk_prepare(sdma->clk_ipg); - if (ret) - return ret; - - ret = clk_prepare(sdma->clk_ahb); - if (ret) - goto err_clk; - ret = devm_request_irq(&pdev->dev, irq, sdma_int_handler, 0, dev_name(&pdev->dev), sdma); if (ret) - goto err_irq; + return ret; sdma->irq = irq; sdma->script_addrs = kzalloc(sizeof(*sdma->script_addrs), GFP_KERNEL); if (!sdma->script_addrs) { ret = -ENOMEM; - goto err_irq; + return ret; } /* initially no scripts available */ @@ -2407,10 +2399,6 @@ static int sdma_probe(struct platform_device *pdev) dma_async_device_unregister(&sdma->dma_device); err_init: kfree(sdma->script_addrs); -err_irq: - clk_unprepare(sdma->clk_ahb); -err_clk: - clk_unprepare(sdma->clk_ipg); return ret; } @@ -2422,8 +2410,6 @@ static void sdma_remove(struct platform_device *pdev) devm_free_irq(&pdev->dev, sdma->irq, sdma); dma_async_device_unregister(&sdma->dma_device); kfree(sdma->script_addrs); - clk_unprepare(sdma->clk_ahb); - clk_unprepare(sdma->clk_ipg); /* Kill the tasklet */ for (i = 0; i < MAX_DMA_CHANNELS; i++) { struct sdma_channel *sdmac = &sdma->channel[i]; From patchwork Fri Aug 30 09:41:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13784823 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2059.outbound.protection.outlook.com [40.107.117.59]) (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 0EEFD179957 for ; Fri, 30 Aug 2024 09:41:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010915; cv=fail; b=cVlrCz3wyHKDZnRHjUWQASgwexE26c3S5pY9s22vw5gFK/lKFA52uj3b5rNSN0AckRhaTFNiDwt1sVSbu2o3BWl3HqyqiAg11IKoRrU0umhtJCF+frshPIGI5tIKQxtQABpWHlHejftrsxEmlFDVuFf27KP4qUnGS6kHV5q7iO4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010915; c=relaxed/simple; bh=JSrVpMV6/L51y8i+ffpQkeXXiw1cXLe3yCiR4GsZXOc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=nT1cv4z6o5Y0uiGUleIVolsdV69yftZw7+Moy+bHbntj6rLg3mpUTtWcLniK63Uu2SLis2ZV26tpYYRUPTJ9/t/+jIF/v386ZSKwxkmzZ6mJF4/SLtKzaJk4jsz42PwJIf7llqxSa/M8zP73QMdFb5moO/+MO2X8yh8WDJ+hhtI= 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=XtxBFWPd; arc=fail smtp.client-ip=40.107.117.59 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="XtxBFWPd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HSYmhSsXkwoRlY+9WiDr2sNJFf8Cm2yhTyYnhqGeiYiAPRxcK+YbTTpGB8rSYGXZGyLFPCWY3hGgIfg6/n95erJ8UhgBlAud6jk278usPyItjOF0RPWLp4skXFjbebvjVeE2FtwZ5WGOVaZRXAjGpVRCk6ECM5azaZe/m3KBI3yGfuznhdE7jABBMFA/mJrAqnXEA0PV/DBjm1ZI3q93vIovInSgLiDvvZ4z8hxVq0DwK61cWUYaNszhRfQ8yoJtO7w+pX9bSJQAwkJ2bNF4fbRMSI3AkzSo30BBUqfZ17I+gTUWfPOXprrsoDJ9lLP0ffDfKs1gdcqeuI+81flCsA== 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=t//JNj3zH8IwaNVFP+SWjbF0AZkMptOSwtNFs21wFN8=; b=r0VAMUj/lsVS9qQAXxCn2Y8EJrsDOQurqdBl3T7XtfY5CrnCPq/fTvnFT+K1nOjHuIxWizpt12pmMGtIfwdABZdUM9g3OqHaRCua3hCMnpKHkLweawqKef0LF4dBBj6EsF1aNVrtxYNEb01u+/zXQZb6jHvGbz6a3IlzDTmcXPgSRBdXFxH7+hKg/Y+XixHIXR6r3UYoz8OzWKt6j9ScykCn/ELf6V/VY9GphScN000lbgofRR0LhzzwSOfJty3WCIxxLdBh5VPfxE5DyOMc3qMxN0XIpXMKNaRKBGws5rfH2GvAn0DCiHO61F8/UozCEClQ3bkuyC425icbD2R62Q== 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=t//JNj3zH8IwaNVFP+SWjbF0AZkMptOSwtNFs21wFN8=; b=XtxBFWPdZ3qgbJQokCPN0pBrTEgTifwpkCIBfFr2WkO+doshr2DsBfHka9rlq0Qw607MdEbuwoEqu7F5h9qojSrlOg78pkRJV8twEIQvOay+1nsk9f5L0/aggpavXcQDLeZVzW7ITASQVXMm4/dOQrnAjVLnSLInxhf5UwH05SEvMFLP6lnBOVWthP8xRB9P9C9JK5ywErE9YGTFfQCWqNuH5/RaW2ZSrBjCX8GgUeNIO4I62+cHfC59FEEwRaLjzKd2mNz0hUxIo3sL0b+7JcEnk4jAIz33eKUm475BlPQyE+EpF7TU+hwJJGnsiaOHu9/UqToKh/dbqlvcoGIrtw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) by PUZPR06MB5619.apcprd06.prod.outlook.com (2603:1096:301:eb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 09:41:46 +0000 Received: from SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6]) by SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6%4]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 09:41:45 +0000 From: Liao Yuanhong To: vkoul@kernel.org Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Liao Yuanhong Subject: [PATCH v2 6/7] dmaengine:milbeaut-hdmac:Use devm_clk_get_enabled() helpers Date: Fri, 30 Aug 2024 17:41:17 +0800 Message-Id: <20240830094118.15458-7-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240830094118.15458-1-liaoyuanhong@vivo.com> References: <20240830094118.15458-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: SG2P153CA0020.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::7) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|PUZPR06MB5619:EE_ X-MS-Office365-Filtering-Correlation-Id: 81e644a8-0bf8-48f6-4d72-08dcc8d7f65c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: DCi8l45U9S1sGJyWBTGuZAfwxqdWaS/5HeHcBJVYh8tLyg2h4NRLYRxYi37+yqvTWn+R1t1yavvwyWFkemtXk7+pasmy5bxa+ARNiz1gi1yKRQy23Y0LZylaeDwusafRLh/nSu06hkAz1jBQRI+LfYCK0qpnBbAJooEPktA91JCxoLDo9sXm6zRM/SgwxBZ4P8g27dviSvBKjVz9/i5JIT3Vd6YP5LC/H0KOxmAYUVQ7xUuoRSHVtMzLSAwcnKdaxiJ9cfYjjFu+Dyn8F4t5oELp1Zfc3OTP3kC2eWAYE0BQYx0jv+F5OF/WtaaoFPM+hRgAuGdO1nnhcy5BevTrOWmusjv6puTYfTttxntJQSIbK0PjW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Y:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5576.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N8urTLkx6frbiFvLyis1bbJwXFC0UuOblQGH38DqJKLm68tLWjgcEtYJYaUa71GhnA72uOmoeiMFvTy/pA7YI+4XBVZJsZR215Rhtq75y+Pnxb5F5mqgKCiRD6479/edV2G/MEC0b63kMPfN8jvfAaOSAhjha+vKDweHtlRIEwwU8BUiIj3SohojHcMk2AezDCw6Tq8aaPaSZVbvw6p3pauZjb4YGGWaMTyfbzwHcR3VkaEkqX8Z3u8IUjkEWGLuW4pbB8DLxuk8ohLRB8tKX8HrywynJoyM7LWgBSkwzHCjlVpBsSc2LrwKCf1ESwkrGqPrYrs8OsTObueh1/B9TeZqkXPF2iyNGSSJqDBcYcJQQyBD/Lo0JH0Dr/Ba4N0SZWrj6kZONbkdibsq3WD2Z8Dh+wkHP2/RiTPFIDhptBz8UJv77A73F2xFcTlvNpXlBPjzqXm9NUKnG4jpTZXV8UdEKzM1RFqHTjUqj0p1suS3BBKYbhVqI4+Hkw7assd8kc/yUSTi/WwvKYhwTeOugQmVNFZ3vJlHyYeQsC8JCGVLUbxIo0BSyb2x3hGxTuwqVkRGQzel50qvVLzztItibRMJQFmuwUKNWViZtgq9pCVQo1oh4NBDpmhEbAJoCD5iXbxHaUJFcXFVtCHZMFwIoZXSdatALt3gSL2xTKGcPdXdH37/mmFHiUXrHEjjcVapj3zRS+InBjNJBoF+gnbXscESrgQ0maV6mRnTnMaXPtg8xzTfG5sJiP/CZEyO6yfAMWr685GgNc5bPu0cD60ie+rnWWLb47jRjJEHCUpI6mGBphK/Dxs4GgMrlhp1hRTvokZoWX7mx1JTHy1SsbEPfpPgl3sOZrcwUGQ87xCqrfMvKZg8/f+PatSJm0OD4AYsZzHC+vjReDia4TSSKtYjLF5Az8U08vUSRFawo97aU8EMyuk3sWGQ+/+bm0lJbWyCcdE6MNYd/R7vE9TxOk6qb5EFaaTrHFn+dhyt742lgSRRO4bXx5VRBp85RN9LTUxE1wpTCaGW6IOUqE2+F86oWjnj7unZKqaQOK5dJ7qorOr8itNE0OfTk/Bf/Jw9u53Kyb0+U0BErIe6BcPi1maUQr0XzkiX9v3AVOKE/Tovw7O6iMe7i9W9z+mqY2M8m7FcSFZ7qYdgCapbJtEn6vGxABxNDSWxh7LDcUbP7nzpVOxVbIbNbcLxWRvNNzid9t83k+FGoTNoztxKITYF9abhtMoD0E/31O56KHq7CMf437hNQaCNY4CJ3rnR22zcFDELX4VnTl09Z8ZHW4xCuBoNV3YJsPQamGKac/NNt1hFcwwYUSulSibwAnLSp1bQXc88wYEOolVDrihNurgk89kIlcKEMqvRAKQeB7BU3MI+Im3Dg952NA4C4vT0bGs83jfzrVBv/zl/MLMy1+lvGwRiTUhlLdntk+1rp/iP0eNwVgHVTi6SEM+NiaR1lpLoTl1CK9jz7ucNW0luSV9tIZQnJYDO+7HP2EX6/PyDEUr1wVt2oJgD+nAm/cHzfhKSK0PN0+qmAfljH5U72rQrSHIbBtyjnerlq0SwK76VX/+kqkyXuEl1u31itwDyW1Q1kuJl X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81e644a8-0bf8-48f6-4d72-08dcc8d7f65c X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 09:41:45.8065 (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: EoSUqAawA/NeAgmxffmoublkhVGF7qAqiYGlIoI5+8BEoafiyMVYzKZTsl5UglJnFpz/WR1CsO/4mFhvxC6M4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5619 Use devm_clk_get_enabled() instead of clk functions in milbeaut-hdmac. Signed-off-by: Liao Yuanhong --- drivers/dma/milbeaut-hdmac.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/dma/milbeaut-hdmac.c b/drivers/dma/milbeaut-hdmac.c index 7b41c670970a..b188bfa9613a 100644 --- a/drivers/dma/milbeaut-hdmac.c +++ b/drivers/dma/milbeaut-hdmac.c @@ -75,7 +75,6 @@ struct milbeaut_hdmac_chan { struct milbeaut_hdmac_device { struct dma_device ddev; - struct clk *clk; void __iomem *reg_base; struct milbeaut_hdmac_chan channels[]; }; @@ -458,6 +457,7 @@ static int milbeaut_hdmac_probe(struct platform_device *pdev) struct milbeaut_hdmac_device *mdev; struct dma_device *ddev; int nr_chans, ret, i; + struct clk *clk; nr_chans = platform_irq_count(pdev); if (nr_chans < 0) @@ -476,16 +476,12 @@ static int milbeaut_hdmac_probe(struct platform_device *pdev) if (IS_ERR(mdev->reg_base)) return PTR_ERR(mdev->reg_base); - mdev->clk = devm_clk_get(dev, NULL); - if (IS_ERR(mdev->clk)) { + clk = devm_clk_get_enabled(dev, NULL); + if (IS_ERR(clk)) { dev_err(dev, "failed to get clock\n"); - return PTR_ERR(mdev->clk); + return PTR_ERR(clk); } - ret = clk_prepare_enable(mdev->clk); - if (ret) - return ret; - ddev = &mdev->ddev; ddev->dev = dev; dma_cap_set(DMA_SLAVE, ddev->cap_mask); @@ -507,12 +503,12 @@ static int milbeaut_hdmac_probe(struct platform_device *pdev) for (i = 0; i < nr_chans; i++) { ret = milbeaut_hdmac_chan_init(pdev, mdev, i); if (ret) - goto disable_clk; + return ret; } ret = dma_async_device_register(ddev); if (ret) - goto disable_clk; + return ret; ret = of_dma_controller_register(dev->of_node, milbeaut_hdmac_xlate, mdev); @@ -525,9 +521,6 @@ static int milbeaut_hdmac_probe(struct platform_device *pdev) unregister_dmac: dma_async_device_unregister(ddev); -disable_clk: - clk_disable_unprepare(mdev->clk); - return ret; } @@ -560,7 +553,6 @@ static void milbeaut_hdmac_remove(struct platform_device *pdev) of_dma_controller_free(pdev->dev.of_node); dma_async_device_unregister(&mdev->ddev); - clk_disable_unprepare(mdev->clk); } static const struct of_device_id milbeaut_hdmac_match[] = { From patchwork Fri Aug 30 09:41:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13784822 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2059.outbound.protection.outlook.com [40.107.117.59]) (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 43AE217DE35 for ; Fri, 30 Aug 2024 09:41:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010913; cv=fail; b=fpd1OUR/QSURkivtctGiERjIIUeJwmIkSO1IiWH3+O9Bl/MJFXpqIcFhR3fXpfdkbBsDoVPJ9gjGyIZlR+L6JKLyuGvdmsQRtsDml76Yeiy2gLjIe18OmbYXMeGaKUc6N+s9/DI8u2nmQeinJVE6m9hxtSLhnOz4sR+4/3Sh7A0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010913; c=relaxed/simple; bh=vcilT1fgufl/wmnpBoZD1a8ZfdOgQgFNPE/9IcSNOus=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=fOekc3RDnGJt1YbsqtRtYyemWH+crXkW2VQCJm9HTXLrRdPlmtrhLzWK3JPbzLZ5193ozIdN6ZYrfOaFBIE2KsIKLI3YGA76RfHSfHwfbhl8KkwmJrnch0bdtJT8PF4TPwrpTdaa7eOcPA4XOIzropBEoVHnVWzl0ZyOFHERWK8= 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=eJW42M7K; arc=fail smtp.client-ip=40.107.117.59 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="eJW42M7K" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lxDV0CrdUpe6HbBa+bLNQS3Q2ftYL9isi0jG3SkBt4PuP+U1HHVH2WX24PXIdoAP77KDkZWb7nT7s65hlO4z092AGC/0oScau5+i18T/HhWevHT0B2vVF1XotQRGpJW8QrSNK7+t8tBr295mUhzGN0oFbuhOlDsBjuOe2MzkU9WvF5YdbmMs19TzQc8NEhi8a4GzKZzqVry2KBXiyd1FSOljtJaxCbD/6ptwhuPPnW6mC2pg6vE4PG+5gZxrRs4YXnxUxd8GN7JwJbs8O7JJm7G/LTMpm821zK0+L9QEDhUpvkOhCMcigcqiJRufXXh9h+wkA38RjoXi53mbUTeJkw== 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=nAIiRvIi1lOxnG91KjnyRmAZG4cwJZ1EK/A8vbDAN40=; b=xB7EF2s5ciu5b1RUTqJrZv1kh7b1CLDwtBAoCu3or7hlxPSMgay5NP6L7nTiKqyRrYUtdFuffQS97vvpN0/K9W8senL2hJrpfrsaUMdh+lwhJWiN6kw/ouClqOWUwCt30pqJe9iMlYp5xyt3WI/jczo9UfHv/8a2W6Wk6TaDzN12PzkbhwHZc3AehahPeqMwQ2aAz6R4DF1yJl4+kBg7W/C74DjKMb08wvoq1Nxzifb+Jxuu+2htwMSQ7xcpgrghfOaOiVolr5apZ6xCXG5LnmF02Osl/pmUQwmix8Gj9/JaXPFE6fcaoDBNl3T+L9fek71etxGxr+E/pcMKJ7VupA== 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=nAIiRvIi1lOxnG91KjnyRmAZG4cwJZ1EK/A8vbDAN40=; b=eJW42M7KrKnTfbB7nsaAyCazF5ixOJmCTF8kTVD2yKRQrcPJBCmCWNk8owB/YczPmzkW9IvziCNfHYH3SMftBZFjM2v9BCDgAIf2FHg8DkiJItNZcjMAqEf9xpDCONIl6NWtx4p+5DNraPJLa9mUyHTqmt3zh5GCducfl5qxf8QDWf/kgTppYDpVfjL2X9J1EXhwHK8tZdCcR/KI/afaiW7M/gUI6DyS174SS0Jm4C9kZGHOnrsBCARziEBnxz0SoHo812UMfhO0d1eeu/9l5uaGr3EiwZmrCGwDUu3s+r0eWuSN+ub/tT2uCJHha4JRkNv3iPbUQsVMAO78lSb/ww== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) by PUZPR06MB5619.apcprd06.prod.outlook.com (2603:1096:301:eb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 09:41:48 +0000 Received: from SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6]) by SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6%4]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 09:41:48 +0000 From: Liao Yuanhong To: vkoul@kernel.org Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Liao Yuanhong Subject: [PATCH v2 7/7] dmaengine:uniphier-mdmac:Use devm_clk_get_enabled() helpers Date: Fri, 30 Aug 2024 17:41:18 +0800 Message-Id: <20240830094118.15458-8-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240830094118.15458-1-liaoyuanhong@vivo.com> References: <20240830094118.15458-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: SG2P153CA0020.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::7) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|PUZPR06MB5619:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ae24e0c-82ed-48f9-0b94-08dcc8d7f7b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: hKfLvSUnScZzn5KH5HVcDPV6mZX/cCaGSsLN5N5QtPdO4vMk7GmGlcKKAAh/JT7YYQLWU1nebfVpAmQS/orl7AMRAC+sm7ujTr6iyQtaNF1qyNUgPbAvzxNogQa/c5McJGCbDlwhDptWmXEn0I1ubU22QUiAs/gYN0Cw3Ig+dm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Hg5vouUz6bEc1OpZKgtZmD/u+KtfRthv1SWj7TQfdKYieuHkTRu00vgAVkJ7j26u1GMW13O/RpxoeJNvXnItiooU5+QTxqYgJUwlRePkTO69vs0AkU3rr1/0oEZ6J9lOhC6dQ+hdIOv6HpzrS/VpHko92XlEF4XG1A2/+g+knWPAaBqg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5576.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3mDpbiX1Q0IJ7RR1Val43ypetMS7hW/j7ajnXyrKQLqqm6QYZA7WqRIkfHtZt5yPelTDA53fXlVznLLiyHpQrBbhJjAHRFFQxBAdFf6M08cqcuBXztjs182Hk08CFuOyYFEAmqhXMNNmI5ekw5Ciu1JD9MJddnIZUFOg50KQpDw6XmQiqeUdl75pRhgz94GitrcrIOrVq9dRcH/ZMxFytSAP+6OONiIiXxpXPxQBWrx1fyTesLArHytzApJV0B7AMJvVdsFfcbLQOA0kPWIRr44A8HVMpcHa5LuEhohjOUV5ZyAaLKlZFG7RVKRLJg70uCCAq6gqNeVNM6BYVFcMjsFI2rSnpYcNSd6K450xlYeDJAvaMNy5Be7YEX8Skx+ZDEFkT/ui0/N7h5z+uaM9cGNZymBEJtk3FysazTtWS9mY/gI6OAkyXNsTLuDOLY5J+mpHOHT215wzSNDrW6upSwMe9c6WxMagrqmANlx/tjPe7Bbu1ouK0UQVqK2kvfwjMK05ffykwi1jV+DKvzihNq4cte75/cYLf8ms39teEfU6QPhtlVhVi9ioB/kocE4KjMxDDzjZz891KadZRdMVn+e5H4lDddaRD/isoZkDYiLCMwcupc/NhzHbjhKLpMNzTVuANevPuO4AoVK1A/t7lvhm7UWECuMQ1irioNrDPTLVoNra/Ze8ROoFUS7QG5tL1cJX1GLOQHomsJemCIw8TT/6e172JL7lmvYsMtoCfYgHNGoiQeiSOdTfWwhWk12JIUPxIWSTwFDrpD8UCPNqhwo0jwHsM2RhBXfDPtSrvnOlkBRylgkcXE+6FIsmOfOXrM2udSjIX/SfzzBHWxoMMaa/jlLIq5VZnsQy+dn7a2bP5CP5Y+jXZGSAWbS3q3bx8iy5UGHBq21vFFx69BguBauN6EtQ+W/Tcaaa+vlNZiZJ/gjVdA9AfqdPpK4ncsxX2XJ+XGhU720zYmbmgDXuqCR5okKA8MizOCWX1/vATtgQUGleL9OPtFFS+D+ebKQmxwGZgYVljJGDHpCaSOkg1+25LM9I79B26ZI9BuqxBjWTLzBjJPclfEyVNI9qIFdvgVSRcK9QkLZzV4ZG8IrxJ3yQTn18VzHGbwKTllJ9AIvKWYHJoSFrP1ILK+PWkO8I4Akp4Fqi/hKSCIQ3ZLaI2h2g9rYr3hb9UpVGrlL/xt791D8YPbPno9tUgRXw55ao+0sFv2uWgDBBRKfLo7b15y6TWKk4/2WaIIQz6jf8WmB3R2q4XKgMocWlj2T24+toPSVb5go480UPrffQvINecJQEJUfje6M+1eIUUvHyxEHq0+JXV1jOaNxtKJEMo+mOuWy3JfUyuAbX1gFk1Is+6jS7MS7b6ABzPKMlLn7rNUZLACOpNL4tlSul9Iv8pkx5sEdjutKHnwWAHlR5JTi2GwiqAI5u0qmEPi+pp/XsequZ7h8Djse9/7UdU94gwzc3tqB9wrxhpHLx20uP2iWFh6dRAGhd6uHwzTOM3wH710YqZCu8nfOd+W70Z6jgCQG42WOFQlTtTfSU1miewytmXw6DBpVADqTdg+dPTizvTg9Fl2+EgJhMDdeeg599+NC/ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ae24e0c-82ed-48f9-0b94-08dcc8d7f7b3 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 09:41:48.0564 (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: yabPy2iy2rKJT6RqFvs1PV0T2tDDLVn1m5j4Tyk/6sMw9jrRJeY8MlOt7xjj4YuvuKtE5E6qxNHDQLozn4SBPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5619 Use devm_clk_get_enabled() instead of clk functions in uniphier-mdmac. Signed-off-by: Liao Yuanhong --- drivers/dma/uniphier-mdmac.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/dma/uniphier-mdmac.c b/drivers/dma/uniphier-mdmac.c index ad7125f6e2ca..6b3570440b70 100644 --- a/drivers/dma/uniphier-mdmac.c +++ b/drivers/dma/uniphier-mdmac.c @@ -66,7 +66,6 @@ struct uniphier_mdmac_chan { struct uniphier_mdmac_device { struct dma_device ddev; - struct clk *clk; void __iomem *reg_base; struct uniphier_mdmac_chan channels[]; }; @@ -383,6 +382,7 @@ static int uniphier_mdmac_probe(struct platform_device *pdev) struct uniphier_mdmac_device *mdev; struct dma_device *ddev; int nr_chans, ret, i; + struct clk *clk; nr_chans = platform_irq_count(pdev); if (nr_chans < 0) @@ -401,16 +401,12 @@ static int uniphier_mdmac_probe(struct platform_device *pdev) if (IS_ERR(mdev->reg_base)) return PTR_ERR(mdev->reg_base); - mdev->clk = devm_clk_get(dev, NULL); - if (IS_ERR(mdev->clk)) { + clk = devm_clk_get_enabled(dev, NULL); + if (IS_ERR(clk)) { dev_err(dev, "failed to get clock\n"); - return PTR_ERR(mdev->clk); + return PTR_ERR(clk); } - ret = clk_prepare_enable(mdev->clk); - if (ret) - return ret; - ddev = &mdev->ddev; ddev->dev = dev; dma_cap_set(DMA_PRIVATE, ddev->cap_mask); @@ -429,12 +425,12 @@ static int uniphier_mdmac_probe(struct platform_device *pdev) for (i = 0; i < nr_chans; i++) { ret = uniphier_mdmac_chan_init(pdev, mdev, i); if (ret) - goto disable_clk; + return ret; } ret = dma_async_device_register(ddev); if (ret) - goto disable_clk; + return ret; ret = of_dma_controller_register(dev->of_node, of_dma_xlate_by_chan_id, ddev); @@ -447,9 +443,6 @@ static int uniphier_mdmac_probe(struct platform_device *pdev) unregister_dmac: dma_async_device_unregister(ddev); -disable_clk: - clk_disable_unprepare(mdev->clk); - return ret; } @@ -482,7 +475,6 @@ static void uniphier_mdmac_remove(struct platform_device *pdev) of_dma_controller_free(pdev->dev.of_node); dma_async_device_unregister(&mdev->ddev); - clk_disable_unprepare(mdev->clk); } static const struct of_device_id uniphier_mdmac_match[] = {