From patchwork Mon Aug 26 08:21:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Liu X-Patchwork-Id: 822645 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2069.outbound.protection.outlook.com [40.107.215.69]) (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 AF5F813DBA7; Mon, 26 Aug 2024 08:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660523; cv=fail; b=HPRLTQgQWN+qnGt+52nSTgSPsNGTcRVt98+voFgjosFPnjSoSbBaUw1j2GqRfBTOfbmpTJPmHmojDYFcSo7pVMlk+JvEPcLlGdRCN4ZQ6cuk2g0MhWHvka4r8Ea3VsvZvekpojh17pbHS/y0aEcMKCUUMhuiR81Ymhwny97Pye4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660523; c=relaxed/simple; bh=YVBSjMz4xvwGs2PRVw+m14n4Yy0III8Kgb+kgRG7l0Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=GsW7SNpmM7kmeKE6q6An1VZCf0uwCsGZ/SvRy7s8W+KH1WJieVbtVF6NwSKU5QhjdKj8AANM/coEqnbtnpjIuTB8AaGonJAPHglu3KJFg3T34FToHHhX1Ffwp1BmDd7UwQrwoNpsiI2NV62VFJWuF3vK7Ozjyy+1ez7rePQrDiQ= 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=U4MONYjr; arc=fail smtp.client-ip=40.107.215.69 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="U4MONYjr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=il42Wti7pc+SLjeudZNcnGM4zsjLpixqCQe9SMpvqqp3CmN6IYvPjqoJN7Anh9Sk+O0VTfY7f0+5cS6waWWDeodQUngvuXwnmYcgm72c6vo2X0qaG4LMN50cTb22yZc/58M9yNm2zbszc2mdwStyLZZX5rpWSmEgyVFLIZszPHepVmDCYCd0hdbdoqCBdwHaDQhIJ/EChZEnCdPRycDPop7Y/meAe9hCPv6Lrdu2Qt+Wd78h3KEqgoIbCwUQeGzGGqdqcBpwIxJSOUJYE8FwMlnDYpSyya0f+oujyOtuJpUmEEKI60Lh3L38ElsVHQeFPG/M0gNE+bmuL+K0G/4eEA== 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=BgIF22dr9N5cHfSHqoggAe1n8qmCyyRhjhPVgM+gwNc=; b=hLl93hDFGUoZ67t0B7KNazVwNLrOF0fuU+Qc9NI2msWrXxneqK83yWwXyTwpaAHZbQ6RFtOTzALdqDb1mof9P5ZVll/w0sc8r7/SXRcknqTDZkmhg8fFtvL7anth6ldCPzkWZnrWkB49siZwxkR8eXW2tNYR0QImzE9kRl0FLkmICCxppjXmSw4iVFPTgkwN2BQfv62RYqeZuvfpp1ELcHjiNNDAaSGSH5ao7zQRYa0rub3qmmsYjsoTEyxAcla66psu8zhjpOnaJqhlVKcubpeH0E56UnE0ASgEsIqB1yZP1bJxiPvsFdBhKhg+lnUC2SxNGKDK1jKwNFW/GIy2oQ== 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=BgIF22dr9N5cHfSHqoggAe1n8qmCyyRhjhPVgM+gwNc=; b=U4MONYjrpAe+zlrt9YMAwMpJu8L505A5gg6ku9eHpK30rIGyRoXSjEdVCJrwuE/sQO3+tecxuKkXP1KKjrTvd1R2UlJPiQ81m9554gpoakrUT/M3B6YqTY49dF8KhmNgYzAGoIT+t6GISYGjabsmPeRNI1uiK2A38QUF+OplCKwAWkz2T2YrKiZxEDrcGXRuhc2n4ZrDMA/2d+L0RKCf4BmVZmdd/56mKNAmUg7LMR7SK6fe+rAkT4JIUYN43apPvv1mtAxQdjvgOwIkmC0QZwP0My3NC/023PzIbU2RfiaLg8wG1Jl07KmjyfIvZWdKxzdkOx2nJZbSDFPKtsLdPg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) by PUZPR06MB6054.apcprd06.prod.outlook.com (2603:1096:301:104::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Mon, 26 Aug 2024 08:21:57 +0000 Received: from SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd]) by SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd%5]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 08:21:57 +0000 From: Lei Liu To: Neal Liu , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , linux-aspeed@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Lei Liu Subject: [PATCH v3 1/5] usb: aspeed_udc: Use devm_clk_get_enabled() helpers Date: Mon, 26 Aug 2024 16:21:39 +0800 Message-Id: <20240826082140.2311-1-liulei.rjpt@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826081900.2284-1-liulei.rjpt@vivo.com> References: <20240826081900.2284-1-liulei.rjpt@vivo.com> X-ClientProxiedBy: TYCPR01CA0056.jpnprd01.prod.outlook.com (2603:1096:405:2::20) To SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5624:EE_|PUZPR06MB6054:EE_ X-MS-Office365-Filtering-Correlation-Id: ef32a74d-2fb8-4b0a-7a2a-08dcc5a826a7 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: 0OJhIANrkzCUIBM6oruxMGZ7JUJjIrl36Vw7Xd7VQpJWQE2DFlqzQGYFfSYhpXTi3CL8AV8We8TmM+aQSVq138BLv/tdqFZMY/uO3BVFSWme3P11OL5DhYp54LtyNKWZwltHSseBfI7R7KDbbyL/29SMjOqek1DF4IC6AgedYZiucolbM4HLphBAWSfldbVYzhuUVchg8cq/N+5WTJH2a0bAKUn73CBHQvkV47Q2T8OPVGVtemi2sdV/q24GsyYFwygKCRVFnbzkfkoVCVrTRbvcUzdfFGRrol3gRgQaaDLCzBO3ndPqbjCHoVUHvU3JZ62fo6C4e6LK4Jn5I0z7tlKtxuYFuKSFufZd3hPRKAylP2jLJUqj2BuRmQC95X8g8XcLgBw/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; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR06MB5624.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: erfj9mjTpfMyMLoVEfkRiNDcr3bxAAMsFrbZRahyxhn2l+zn+FQQOz95D0Lfz5O87DDtZYmn6WPywRuBfUPkl1R/CeL/vmBbbfw8X/BJSm15Ab3JwX9W9ZemQYNstDwLcE2zZZ84H5ujRbMN9H+Elw8uUMrtWPnCzsk1x10Fi16XzMpMqxKs+EyvGONeLH71v0aAwXfI5InLmnmwVFPDExGq3FiaJPHWKUM8/5v6hkl3IL2yWWXca2Pe+rlys3XwwHZOnVPI3f3lHEj6tP7ZC42PQ2VzRcPwHyVp6dBaKTG97/1OlX1frF++/IXqfwJki9xDmFXrRRXnR9q5p9wIJvZt9fsPcYLLSftN+znH5tJd6U/tG8tU1x5Q21bKvOOeLpAU2rVUos9oKR6lbqaA30EVkB6/fZowBUic1vL62V32OaLK9Ln9rHY6gAOrWnr1Vq0O6sKMJgcnuR/Ek0gJX0OF9q10lvEvuv6ZGKXrfhk4nPNVOvXHQsc8Us2yXRds9NcYPEQ+lFKvSmp1ezHeDegFeZH/lOivwt6B6T4Nwlfac8wA30QZGldeZNgK05hbYqZkHdp73UNclaPPF2BGajHvCSyOiZHMqQcv2FDkCbyA7n5Aq4ruuxsJwvycc3rBYzjM1YB3NJoOw2x4oF7rSbKHJh2Uv8pZ7xmGAXjq4v4Fg+qK6r7f+q6L/9mWR+zlLL0+yJXjZ+hCL51EPA1zBY7RK9J6Y4L7yop2hLdg0fyYggDn71bSU7RNput9Slk4XHiwtJ4qxG+rAlj2y0lOG4N40CBY+ZGfB/tNRC+Wy5jPbmU+IcVCebYIqRrXIUZEKcqJfm1+7Ua94jze3y2DzKyqRY2MJyFKeDZOkfzgQGUZqwIWjBUx8td4AJZTTfF7sqxg4dqr5LWrFCStYNZ23A6ixWYx36nL7tFJ/+WVRs1we4zW18Bjk28DLuom4AE0OCoPVIXJs+ltzo6CiVQBB9Fpoz9FTv3KYrZsIf9yICrzw+5fiXduRzisOpgMlvqetdBOnxAz9UNa7Cb7DdB2WaJ3JsgJEuZ2WaL0NiZeeBmixGnf/xVCW4csfKbSZaqzFEs9AEDARSJ23wjEN7S108tpMDTTIIgnmowECrfCJ/+Np0QsdcYU7agrUsJByAm4HXSweKfzR4KCNGpbNauXFyo6isRoUYiZEewHKp33UtxZK1a4eKc9ELLeIzcFn5XMVTZiX6a+5F2L22eIY59ugTA7nxQm9wDlMgzlrNHjqWOa6MVDv1q51SdWFpe1mhXS5YZq8E/twkRYdfKf2lnnjzfZI/RJhZw52o43cApfoRzfcFtoIwGQEy+AztVcjMScKWkfewpMbY99xxJsmx79kJsxah8PQyUZG2gxWscUGJieDfwciU0Vt7dziHjvV2zerigj+wDCCONmNj8jaihwqJLMgGrqpJRlZ5amiYo+qGxGu+Ng3gbRDPql7WCHBeDiTJBQdzgIvaujg27hh8+SXuFtT+cZovdFzwIjgQAqwVDKz8EIOcNngXLlkevCdgS92ng/1jtxcDf+Qr4PioZvx99ipyLYrJD2gwgSgZA1bPyhVQbj0lP+eHchagqJDFIk X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef32a74d-2fb8-4b0a-7a2a-08dcc5a826a7 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5624.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 08:21:57.5967 (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: Fp1d+PeSB7l4oKi/hEi3KU9E7WVLgQ9cdTiTXtFKkvJsRrRFOOxe+zAzATkHkLBmHPalGjMftN+mav+Ym+s4vw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB6054 The devm_clk_get_enabled() helpers: - call devm_clk_get() - call clk_prepare_enable() and register what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids calls to clk_disable_unprepare(). Signed-off-by: Lei Liu --- drivers/usb/gadget/udc/aspeed_udc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c index f4781e611aaa..a362e31f7550 100644 --- a/drivers/usb/gadget/udc/aspeed_udc.c +++ b/drivers/usb/gadget/udc/aspeed_udc.c @@ -1459,8 +1459,6 @@ static void ast_udc_remove(struct platform_device *pdev) ctrl = ast_udc_read(udc, AST_UDC_FUNC_CTRL) & ~USB_UPSTREAM_EN; ast_udc_write(udc, ctrl, AST_UDC_FUNC_CTRL); - clk_disable_unprepare(udc->clk); - spin_unlock_irqrestore(&udc->lock, flags); if (udc->ep0_buf) @@ -1500,16 +1498,11 @@ static int ast_udc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, udc); - udc->clk = devm_clk_get(&pdev->dev, NULL); + udc->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(udc->clk)) { rc = PTR_ERR(udc->clk); goto err; } - rc = clk_prepare_enable(udc->clk); - if (rc) { - dev_err(&pdev->dev, "Failed to enable clock (0x%x)\n", rc); - goto err; - } /* Check if we need to limit the HW to USB1 */ max_speed = usb_get_maximum_speed(&pdev->dev); From patchwork Mon Aug 26 08:22:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Liu X-Patchwork-Id: 823027 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2087.outbound.protection.outlook.com [40.107.117.87]) (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 684D213B792; Mon, 26 Aug 2024 08:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660555; cv=fail; b=blVre+nl19WG8Y9oA1pRz8zPAZlzKiY+UoLrwWVSYFHc/nRLU1MIr4SWqTB06QIgs0Ic1KH3Ck7HneiwL3L0L7hzog/eSqGrl+e3uWxqLQD2Xv7P7rIuWw9RVYdOsFmT/yPdiGh+XdTKi5w7MIryIVs5IlN01YsIy8q76LkGIyU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660555; c=relaxed/simple; bh=SSmG5Bem7qyikRpOoPuSLc1AvczZr1/Eeugsj3e5GVM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=tEy0hxrSHJIOIgX/Co3hfWO+ApiFhKB+73dHfQDpMZoN+CMvjEq8DuawuKMTLhXm2kPxg1u7QLFsXgScTRKKO2qZJEa8n2Q7hQMNVJfJHnPpYjQ8UM2RHzH/KqobR3pGEsMJ/dYhurHHs/8/guUx7NGmEb2KGyeiW3fyxUHwFGQ= 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=f2VpBji0; arc=fail smtp.client-ip=40.107.117.87 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="f2VpBji0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NI7GoHlW1Lhve8MWkpPNn3S3hzqfAaN2vbpxD/X1sFq5z3XTWGawtJifOSSuoXW5GAju3IGAoGq6JOtHDWa862kHrRZ7jIBpmTNGZ4yI03hOLNJt+Ird/hL8zpxRFlJxF2zspaaKEV62X8/WAaOEPzmLh/AZjwMyHKcKgGC+ueUSH6EHSlRKYneOvfileORU46pTlfGwWmNW5O4zBP1eYDrhb7UoWWzr12VbVU9NJsWwdwehE3nJOzq9f4IdCIJvQ6S0tEcWznVD82Oza+SDNC/LyN0OSsZuP4hGjCpnIYrRiCoMB7/kDIbcmHQjeIWYpZAfrVsD4IVEPD16PofxYA== 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=8qz03x8h02qC6gDrmqTA01oA9enpmey7Xz0yBtUzGqA=; b=UN8CmoGK8T/xBYYom+fP0H+iVXM+DmvJ39L925JepGuH9PsTiaitQxao8lOzLxAcpXXXWu7mdSn2so8HNt9XkIbDWuEH4NaNCd/vHWTScLfwu7mRCaHi3I7IdKzpRtC7/S6rzMwaGUI25+3ZDy65/5ESuSFqlYrS64hhFZfCkdeST8G4UyS8MOAAHnR9uCMYr5/KtWx5c93H5SApFjSyfQv4Ajh+c55r/KnPHmZKBNBGkVIpeG1BUsr5so9Io8gIPmEC5u1lFtz1QHmnwLjZ7mTyKXbZof9g3Q+r2qfDdVyHHtHT1VZC6gM4/lIztwowU8xQj/sL2hlpoFMVG8Px/w== 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=8qz03x8h02qC6gDrmqTA01oA9enpmey7Xz0yBtUzGqA=; b=f2VpBji0oG7TWdE2h5zEBfx05DoinIQWuA2sfmZdc/JRLzbxNH+AYgzM/j4xh2ea/X8upa1QLskLS8goCXfVIqmDpNfq8N/Cgdn/R8Kj4IBUGvYbv8b2rgXOeDU9C06ibqDe44eborIdZt+60U39r/6XCxNunrRtGyNdrScGsGC6umK7UyKjYpbdvUVd0Vx3K+GJiVl8/G6IDvMM1Y6M2kAfOptHEz1DjqZyIpuK73NPz0Inex+Qu6NdUy0iOXev4ZaQyg0ZMayK1zo0aL7d+yePNey30M2Nkth8FAvKVi8dAIlQ+I7BSTfRqdqNwvDpDuqTiUKYfyhJ+1yPWqe55A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) by PUZPR06MB6054.apcprd06.prod.outlook.com (2603:1096:301:104::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Mon, 26 Aug 2024 08:22:30 +0000 Received: from SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd]) by SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd%5]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 08:22:30 +0000 From: Lei Liu To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Lei Liu Subject: [PATCH v3 2/5] usb: pxa27x_udc: Use devm_clk_get_enabled() helpers Date: Mon, 26 Aug 2024 16:22:18 +0800 Message-Id: <20240826082218.2331-1-liulei.rjpt@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826081900.2284-1-liulei.rjpt@vivo.com> References: <20240826081900.2284-1-liulei.rjpt@vivo.com> X-ClientProxiedBy: TYCP286CA0240.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c7::16) To SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5624:EE_|PUZPR06MB6054:EE_ X-MS-Office365-Filtering-Correlation-Id: 481591dc-2705-4383-723b-08dcc5a83a55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|52116014|366016|38350700014|41080700001; X-Microsoft-Antispam-Message-Info: I67nQJVehKDnOjTiIl/EFCT1FKS0TQ9vJwdvE6RiKO2ctSWpvMwNr859IRWmPgLi8ur93Qd1OJawbzyYfFlGE7dV/9WVUsuXHSYwQB04iHQ/H35k63Nr5Rb9qeHmGDLu75zMvV4XZaHSLvMOblS9N7A7NawYhXBnYP+1MjwC9XNiAlXhHSYmMLREPdNpUMFu32pFPGavPIrLssbwaw0ngwMVOkTLQHTkr4m1vfkawtOnyAFpqVQrKtjnp6MbOo/GLj3JTsunZhaVBJXO9fUC5U18EOJU8RL6Ajc7wb9N4V+rHkLOPe5bTPSRuxIeY49giRn1JGd/M8tmwBbH4IRmBHfwWMJTRRJpXAlOpxQQXK0IY8moouItxH8GkNfq8rAIAkWFhNlngjNfV6HUfvU0w10lUSR1MOs3RJhOmjd2elI8oANH23R4i3yg96tbkAAkcrSH0geoR5AtPfEvJBwUGHwml0xrwaMTJS+HcHY844d3qJiK0roebzxb9y89GuS//cO133C1DGiU364srSQ9q/I/TigksyCEVkBhRqAdAknrZIrPxmOHTcXzwejKnyQhgDUxDMfesFJZJYYr7LiR84Flksr1eQzV7Y20PjhLay+QbgK/X+t7RGxzibtRSHSB1hNbFob7rXTSz/3a1ALrzhS1I6a9cHPBZybxRiUdfvxdObpI17g0q6S11PC9pfZDgn5wHGfDsdeVA+Z+inH8ig8+ZF6ctsVe3NxSn/GUQ0FSMP/HmaNTLF+WvIZjjqm5aCmb6gTK1Le/SLaK/qxGCyDVdcXHigUMjhIZRyLk16B268DnRA+oL5dqYkFopOnm4pC5acd5XKGPsuD9Y35t3y4Xwb1btczbMIabT2dEUubWgNyt/O0E2PXHIW91jhAKy/xGuRpZ2qLG6XJYsnKI9MZUNl4pSBdksudwRTnTxWZaeUHIiptq74S0n4HI0uU9xRfBHVrEKtOcgseE4s7IQIkzM/ZbqkNCo6F8o/VLwxI3+khB+USguJ7TGqSzkHpPbmi78GSXrW474a0jWmFnq3KYgfZSI9DmXtRV3LvWR5avliQ+lr3N+IajXyYl67FeMlTCteImDN6/znj/cq8ECzkvYpVXEOYQPpLedZJuG8GcBmJVOXK9qF24dPZ0rusCaCpPE38C+rUAClbs/gBSpQngiwlsher7TuIGV+KVXVkJOdpeJM1nGBUP6mO0lLcHrZKEzpKLyUDPyp/zel5sqxb12IyyYU9ojtic4kd+W7bN7VtHdgc2sYr6BEKaYVvs8/uviGpuBMCjve27mqyx+exmGEotWWt7NKgjNZnYHdwb9IadtpLHs5d7g0+mUJ4T/VRU0blnqPUWHZBfQVE4ykaCn2Md8tB9wJ6lZLgjc7dIWiWkQNyQYizBtqcwRRZdnxnQZHBnJCal2zaHxIX7J3s06wg5NTAG1Ha+fjI2Cfo02ndfNfzx+hSEvKWXS95T X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR06MB5624.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014)(41080700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-Chun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yZmHX+C0QIzrL9iPI87tkAdoxPqLHD+XoV3yIN1gjmaG+OYLiGP6kppz30v8zjppVkaZtU155Qffit8gNdjYG2dn4+0BHVi5I48xrrbhPSIM+je2xWq4iKROWJI856MQE0WXhOqcO/Ljgo8LRKtRv+AytjRbFsKUD8E+NhQLIJAFtAnM3VBFW/mjhw+BaMOIQDxu85RwH3ro/b2nY7AbtaTZv19V78HzjWyfGxXWEyQNaCv+2Nw6WVg8jIjqUhrt4IwMPu0q9glMy/4AdDnYuzODa/PJzqmgtBzdV9oxtJL6MobZTWdN1ILXM1zu5nkrmPkzJfHW6B/7p+/9Qg72j/L+Ijxk0ikMu1yB9KFSZf2WLOGqbKgHfCd4BddZ5E42w1tHdVN9fxm1wEmk+NK095iq8uMA0/7N88fu28BAOSPYjDMijWMxBN7eEsaJ9S+QJcvXmzt2UiG2MKeX30h6r9drduXuyJhOEiVpF5DrSkib4kESXr0xsqJbPSzce6p7u0qstOZJQ3SPcaHCIiN8hos8Esl4M4c7p9Zk3uCNCI1efyAfgJ+rgwV X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 481591dc-2705-4383-723b-08dcc5a83a55 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5624.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 08:22:30.6209 (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: Vfm6OgEXHV3gciNhj/fK5ALuSEJCDuPodueYxcXvbn3DZYnKhmewt3D2aZU2IUkzyfuZywvtRZ1/s8VT49/Y9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB6054 The devm_clk_get_enabled() helpers: - call devm_clk_get() - call clk_prepare_enable() and register what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids calls to clk_disable_unprepare(). --- v2 -> v3 Fix the email thread. --- v1 -> v2 Incorrect usage of clk_prepare_enable() should be corrected to devm_clk_get_enabled(). Signed-off-by: Lei Liu --- drivers/usb/gadget/udc/pxa27x_udc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c index 1a6317e4b2a3..0619507d187e 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c @@ -2398,14 +2398,10 @@ static int pxa_udc_probe(struct platform_device *pdev) if (udc->gpiod) gpiod_direction_output(udc->gpiod, 0); - udc->clk = devm_clk_get(&pdev->dev, NULL); + udc->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(udc->clk)) return PTR_ERR(udc->clk); - retval = clk_prepare(udc->clk); - if (retval) - return retval; - udc->vbus_sensed = 0; the_controller = udc; From patchwork Mon Aug 26 08:23:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Liu X-Patchwork-Id: 822644 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2076.outbound.protection.outlook.com [40.107.255.76]) (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 990111482E7; Mon, 26 Aug 2024 08:23:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660632; cv=fail; b=a2c2FnLz7zgq99HUoHzj0iye93BoiWM59X7G3q5sIgebqDjIUMF5Gyuk8JhMMdwU8vkYblFiQLRyJSe41Q4vV4VMni9gkcLfWc5+4RdvKJzDIJ3oss+WxN4NAKKEhQK1Tg38HBtpdPZoxLuNFU98Dxcky7q3hJPkUYt2iTdNEYY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660632; c=relaxed/simple; bh=4JEh5659lE4oCzyGydPMyjW1bqFusCVtsG62nasmUeo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=A30qqXFAVBHkDFUfdsN12H/SQB+jeS2Oc80i5skDuz4sFlRks9xK3dQLltejd7Ly8z97vE7f0MhMSBLyWyDy7o3ypxBiuQgsHwNQF+L9e7bHySBHapAu72xJj08PGv26xBVqU2FA1vHFnAPaKRCvzby2Xg4oaL+zK46mHT2dfaY= 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=epXNdYT+; arc=fail smtp.client-ip=40.107.255.76 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="epXNdYT+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q+rThOSVDE81U/Eu6t0P/TbfcO/tDNnNGqaFnrq4XuBr2cMhXlsDZsDiJZDdljZ2UYKgyQjOXsBL9kEGI03QueC6fBS55aWf6TWG/1eK5oTvRJ1HEgUAVWibda6B0Bc2A3JmcspiSGZicZiuaE8x0zKN0/IexS9EsObAl49gCctS5BFXmT9M06BaE8oPy1yRTorJVghzmsdpqVBdjFJdaFmnCrXUKWAHyZiclSlo1ic9thkpCrtfphtaZbeyn49gCAq1pTsfMKqxDNswO4Sxxue/nB4TsIHWQZNU1/XnHNUK4Z4Uqbu21YUMXz1Cgwrd2iiH7B6PRuq+OU8dBScNkA== 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=eYwqVf5nC1G106y3/JeoEY92jkLlLo2RAUiFL4iAX5k=; b=BA8U1KbHJ0+WSl+DX6vlcmDJDFnpeVHjQzfyr4xMrMWhqPNB1D9XjjAttoemK66+bu9HhsCijSm9muE3lEEZLH3PoOQ0F7PhWNDvmVNAWERpATsi09b5EcPAIc8ZRZmIEsP8nbK4akEAm31BIT3fqV7LixCv/tq5NXjIdFXhP7jGUgxd/vFI8E7Hh4zpMAx2/1hIeL+TGvx/lBzjkoOnm2/MaoKXl2YxKxBve4p8XGFJmY5jEsNBAK+6eWZmP6RV2MYR1q1QerICwmpNyrMPAjR9KI8y8JxLbKgCC4NgMHnwALwJIBykULxJ9zdF1ddufsIz2f3YYlZGpy6+AemvvA== 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=eYwqVf5nC1G106y3/JeoEY92jkLlLo2RAUiFL4iAX5k=; b=epXNdYT+UPyJ076fAo0Z11gY9g87nA2STXAmCe7u4lpnqNoYS9/6UnWvW0Zg6s1GeI2mruYtrR1FpXU3/bOpLHvBMLJagXUIJwXgUltGcMgjOz9akXuOATIgCdX7S6IAmscr+OfoBpBBDXdT0mrkCKaHuUN7Ixj29vEedq5EtEOX+oe7BTHyaQIWruwQTta5iC2c7HiMkMkRbdL+ZQ5qZIg7Q2aiuClA9XEf73zG9KdDTMp9GvXKKvYlVjGEih7G1U2sQ2sFRteW26pvad7LnPe7NSk3MTHrqgZPnyJjMTNdxphFQ71bosjwUPcgXvMmSmpdXwOmwBxi641TU8POVg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) by PUZPR06MB6054.apcprd06.prod.outlook.com (2603:1096:301:104::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Mon, 26 Aug 2024 08:23:47 +0000 Received: from SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd]) by SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd%5]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 08:23:47 +0000 From: Lei Liu To: Greg Kroah-Hartman , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Lei Liu , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v3 3/5] usb: r8a66597-udc: Use devm_clk_get_enabled() helpers Date: Mon, 26 Aug 2024 16:23:31 +0800 Message-Id: <20240826082334.2351-1-liulei.rjpt@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826081900.2284-1-liulei.rjpt@vivo.com> References: <20240826081900.2284-1-liulei.rjpt@vivo.com> X-ClientProxiedBy: TY2PR02CA0063.apcprd02.prod.outlook.com (2603:1096:404:e2::27) To SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5624:EE_|PUZPR06MB6054:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c202a4f-3b64-4f0b-df48-08dcc5a86811 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: f6T4p0syyCNfjTnZ3F81U4PPxHZ3Qq68Y/3J3fWaINVEzx5UyjwOdtrLolvHCkeoqzdBg7KkjTEZfVra0TLlYPEWLqh/8CMF/cK6yHh9Xdfu0kTgAPqnzvxfi9cc9SXXFbIeOMU0gslkZrOfnpv3Mu6F8/hyWcDQKx+UJAcciZs0t/Ea1+I05qezN8Tsd8xtR1MbIaf3sGtzMV2f6fU/4dAnhXuMWTWxgYlCxTbTFGmtqWXO6Yn/3meeub84qFygBi5LKhqVbLCh4l8tiMCC6K1iH4Iw/d8tEfR+5IyuZte1BDD4ZxYn1tcP8Td9md0sel/CvvQslV7uA6BfhGNakzmlgAyPx1blKKzFUJtTqXjWZRuFv0xW1yuWVCB0ZHvIasr2m6yA0peW1xE45H2b1d2RGB9PPGM3wtiP4fAvvQfYeZjwmGqtgoVQcUg9Z2el/Eu2Ljd2jFgWRcbM/qtoSaJwBYXZri4cq7y1MhhoqU4ZyyCXw44DbjtSeeALwh0T3UwvdUnAYmLMhr5J87ROLqaOYM92d+n/oH/zD+O9R/+wsp3+2r0SlTTWRoLf9754rqItyt6s+lwVXJCsiJp8eY/xCaL+67Yl0NJESXCvlfb1PYECsplXnHbwXmJ+b85fYOOyc7rdEuAyarJnGpy38QrzncNwlfUUs15ecboIb2RKa/ZT876+UdhmtblpE6whMvEq63h3Fkl5X2jLBjEqfwtCDHbxIzLywkc0rk2WvfNQLKJghyGFAosSCanMJaKsp39MiTsRJ9tZsCHABbJ65VIwFOfWYMSsvIxmhZuztsWAe45/qtv4Oufzhed7M20g6dPx2Zp163TeqL7Yn6uYCG0wHbx7fjSFHrUPvrhM1q3jPOn6jc6PIciPBA0PM/thSpt9J/dSHaY8gjMSMQPfZpNXwPsczVPsnhbRlCY2ObWctXdSF6d74+aEo7+rviJaWcNP8LWsJGo1MFM9guDawd8xWDibas/jijDoux90mSskkCiIxdxHsnTKkIUtyZVNW7re4oky71LrquzllOEyeKKkPwGTj+C9x4gPtWc9tkcuOcUPd9+W6ZmdKLSocGf/V2M9UGx2VNqKie2cTHw7V85uncRlzEVvno/bNCMA12pHiToUNXH4rTP3K69MDG+sfS8TSzsLoJxcE42qUb49EUzhaEzpFeqk+FpMWRw+rbOzLT7KTuas+VKi5uU7pGHEvXEYIhygCHpnV8kkN6mjIC7XuodfiKmK7zvW08lWUprLVqEUlAjFDMCO/ru1gcpwvcOsoM8jSHF53d+keIRqklpqbHkm2UIPzsSyf50TmlD84k7T3kUo0ormLpLanWcGzWM8ZDkcTY/QqRIaxlRRDiAFxcxnglTFj93xueLF7f2yqzRYs9OuiC1yHWKCzhtLJ/UEiA5gGDCZqzvx8o86Mg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR06MB5624.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: PNkAW35tiSfntYE34CoQpM2Oe+uA4G0OA1mlIzrEqGJvXO1mpv5F7BQiakZqAHU0mj/KLYV1LBrqi+OXr2JVFhfEsQFvux+fMarJJ6zGsOmk3Lk1qOETk51V33x+LwlcjTrmIkXLgp+zDYrSP98mnvdIw97brUUb7hBH8YJMYkfSFebybQlsmEb7wM5iUWx9VM2tAM/nZBqUf+wqMqnX6cYZ9E1ff6IJnDAkghH1dxK7ZywBLxFn8fBj58OFNh2ILd1MQtKk346TBIi7IbTP6Y0/zCfxvr6BbSHhPytodFpvocJbotpFoy3AkAMX6ht6c0ePog5Y9SWEvMC3oJKoVaYafUXIRwLma6dHtZYZ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bCTVF5M/RUAyu3v4qT34N/5MoPFLDiqbb3KgjZTY+jVrWp7upG3xSto107zd2hwv59MnQl268dyHgQiZt9LmLu00f6qAvytwZ6UT39ed639N/efk2ysDX6PxmSITJQL2dfXHnUvTnUPRtxFY34BBXUII5PibSfYaSFAa+fz2 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c202a4f-3b64-4f0b-df48-08dcc5a86811 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5624.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 08:23:47.2999 (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: 98JeypoN/feg0FXQnOz5gJZfHd3m/Ilw1ECUdSJAAPIgo/XZaBi/M349LsRctjTlFscASkmk5d0lVnmMicz6CA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB6054 The devm_clk_get_enabled() helpers: - call devm_clk_get() - call clk_prepare_enable() and register what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids calls to clk_disable_unprepare(). Signed-off-by: Lei Liu --- drivers/usb/gadget/udc/r8a66597-udc.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c b/drivers/usb/gadget/udc/r8a66597-udc.c index db4a10a979f9..bdbe5ead741e 100644 --- a/drivers/usb/gadget/udc/r8a66597-udc.c +++ b/drivers/usb/gadget/udc/r8a66597-udc.c @@ -1812,10 +1812,6 @@ static void r8a66597_remove(struct platform_device *pdev) usb_del_gadget_udc(&r8a66597->gadget); del_timer_sync(&r8a66597->timer); r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req); - - if (r8a66597->pdata->on_chip) { - clk_disable_unprepare(r8a66597->clk); - } } static void nop_completion(struct usb_ep *ep, struct usb_request *r) @@ -1876,18 +1872,17 @@ static int r8a66597_probe(struct platform_device *pdev) if (r8a66597->pdata->on_chip) { snprintf(clk_name, sizeof(clk_name), "usb%d", pdev->id); - r8a66597->clk = devm_clk_get(dev, clk_name); + r8a66597->clk = devm_clk_get_enabled(dev, clk_name); if (IS_ERR(r8a66597->clk)) { dev_err(dev, "cannot get clock \"%s\"\n", clk_name); return PTR_ERR(r8a66597->clk); } - clk_prepare_enable(r8a66597->clk); } if (r8a66597->pdata->sudmac) { ret = r8a66597_sudmac_ioremap(r8a66597, pdev); if (ret < 0) - goto clean_up2; + goto err_add_udc; } disable_controller(r8a66597); /* make sure controller is disabled */ @@ -1896,7 +1891,7 @@ static int r8a66597_probe(struct platform_device *pdev) udc_name, r8a66597); if (ret < 0) { dev_err(dev, "request_irq error (%d)\n", ret); - goto clean_up2; + goto err_add_udc; } INIT_LIST_HEAD(&r8a66597->gadget.ep_list); @@ -1939,7 +1934,7 @@ static int r8a66597_probe(struct platform_device *pdev) GFP_KERNEL); if (r8a66597->ep0_req == NULL) { ret = -ENOMEM; - goto clean_up2; + goto err_add_udc; } r8a66597->ep0_req->complete = nop_completion; @@ -1952,9 +1947,6 @@ static int r8a66597_probe(struct platform_device *pdev) err_add_udc: r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req); -clean_up2: - if (r8a66597->pdata->on_chip) - clk_disable_unprepare(r8a66597->clk); if (r8a66597->ep0_req) r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req); From patchwork Mon Aug 26 08:23:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Liu X-Patchwork-Id: 823026 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 B6EA813AD13; Mon, 26 Aug 2024 08:24:31 +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=1724660673; cv=fail; b=WL3lAfoJdBBGbixnfTJ6R5C90UMa42rNWGYPrQ+GxZUoLJGReeKFiTBlJ1nKCcE69Sx8yIdn5mnGCMWWFfHRwM4YgmKeTaQ8LQsmvXzTr/HY2+BNPN8rzcEvcR0N3UMuVEECqCluRjmXMO8oW9diMfxJQ5bCw0BRLzt5DbhnHZc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660673; c=relaxed/simple; bh=Jyhk/ACcW7BmHdQ+pWMsaUrZlmvvkeXyGamureVZiF8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=PadpUM8qVTGe7g+1niUa5LZG2J3dNC8LxBD7gVpWquY+jy50Wfzp1HRBzPn74o2EeVf8j3SPlEhhxTEubOWmj1RmQ2dIROzILLw3jArwWMbd3ranZMQ/v3QFo7hxBklHAbJoifEENp/TnjpOePPEyyZvUbtHUA2pDVDvZjmbxDE= 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=nD6YmoyF; 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="nD6YmoyF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RE0UzW+w3FUEKhdiUmjVFdFgAnL3F8PsvkKHDr+lE5yijMJpU8aygTjN3u+V2/pLRbj4SgEDe5kxbC4VqmnJnY5MunC5+r+PXbt2DePajMay1mQlaJ3tCFyliNPEgjY9OPQhstsa8kR/RpTRFNIVP9xkZbzE3iqPg6WvIuor5gkV0qDNoOuhw5y9my7JTnBmzFhtS/iJG3hknUqU8mpJXIlOyK/Yyd0LTbOOJn5UxS2Qpe1IfHgFymVzuhQbhdsAB1W1nQhFxSDG9hk8tO6EgS1k2pwJOB9PbAF5nZwNZyypFFO3PpRB/MVW7a2RJ882en/sLbJl1cwMDNYxXB8okw== 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=FCw5w8EU350n+BCInvshnTXKpjthG+654hsAT1zd3Z8=; b=zQ1PKjPMB6tV0kxhH3JjJAhA9thjRUPhlnl5l50j95BjV1jM8RuyqkD6NmRdFce6q3tyLIeiPtPIXarefap01q6X2HyyR5sgDZ0H7fUbF85nkdkIcQC57Dp4B/bSCljZPMf4NKDwU72UNsWMeFGjyxRezxrWmM0TGjrEj8I84iD08K/goYJvrlbfLzpv9YSlc9nDw/1Rsw/2lynAhfRIyH6DMlVAdhd5Z34ValYfx26B6tDwlxJPGlvFbBvZYjvfe/hbY5hyBMLZHHtl08Gz9Orv+v2aO9qEqcQsM1Q7bYW0uw0BH3SHmz46b9Zf323C1SN0A8bULjadp+TaCpnMXA== 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=FCw5w8EU350n+BCInvshnTXKpjthG+654hsAT1zd3Z8=; b=nD6YmoyFijfuZkULgtOtsH4sPVELMX8iVwxWrD7bC67nKhGys8dWaBHYW9Duh9aXAdPHKJ2o3VVWP5hdlAuA7iRsnrG87pSk74X0sDIkroUM1tmvQ1lXdDceWBCCmWMsMcXliJ82RVOeVTy77neA/ggvFAg25IYqb45jEc+2avjr0LDHKpthe+lf30nACV8rwN68JpX0HlZAAUt8Z4XG3hUsFzpjzq4fl2fJo+vV9aTb3lmVNZQ0YToxk8XalYTHVxIlag7AIcbyiszBVPc7Vxz6+CE2KpNCq5Z/FLN0cEv/RkJ77wF1p+VEUBo3G6S1BYJFcyGy/f346lz1kGq9Iw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) by SEZPR06MB6665.apcprd06.prod.outlook.com (2603:1096:101:17c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Mon, 26 Aug 2024 08:24:25 +0000 Received: from SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd]) by SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd%5]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 08:24:25 +0000 From: Lei Liu To: Conor Dooley , Daire McNamara , Bin Liu , Greg Kroah-Hartman , linux-riscv@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Lei Liu Subject: [PATCH v3 4/5] usb: mpfs: Use devm_clk_get_enabled() helpers Date: Mon, 26 Aug 2024 16:23:52 +0800 Message-Id: <20240826082353.2373-1-liulei.rjpt@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826081900.2284-1-liulei.rjpt@vivo.com> References: <20240826081900.2284-1-liulei.rjpt@vivo.com> X-ClientProxiedBy: TYWP286CA0030.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:262::20) To SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5624:EE_|SEZPR06MB6665:EE_ X-MS-Office365-Filtering-Correlation-Id: cdd17397-f1f8-4431-60f5-08dcc5a87ec8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: AwzSxa2HqILEvdMAIe1CMFd+n3ovaci7fdOAn7tc8VJzcfaE13hZK6mI/T1XtDkxVWQT4NyWEv3tD5YlPBqb0wp/mgFxO73IBsPMIr2vG17Q/YUGSHZBqOp6EPmXEz5RawFuH68OsAOKUUm5Jl9OjT7x1MWoOa/e5lvMjkmCsJya7OmU6Mm3gpF5jmM5R++/8N1Hirjyj42QdcP8IDo6VYnDoZFNOA6KoR4/f9dl35t45wPFofpnS4vEM8gNUh37PqXRlby6qdM6yaV4fNAZqDWijVQ65RYcDtibdEMK1/TKgNmrJvv17/obUD7S1RFWl8IGlOdQMPGPcLaEVeLlFnwp89neo2PETTuGtqwQ5x3lh2dJq6s0Qk90m7CXQgHQx6huHpA9M+YlIaNI6IBItx5ybWvpbYRS/DSMeKEmiDZ1Z/ESTfb2/Bp26KGJ6XnFo85AjgFdh+e2CctWxROZUs0pzqLEIxuhosLOut2+Tjg/EOjEoTXmMcjhRYT3ITDlO83f+NbpHbG81JazLeaSr9xPgAT9O/FYDWc5URI2Z/oSbgRUNFxkXENVseg/46ewcI6bSr8ie5ACP3QMflds/iSc3hATB6o0+E2XrB7AqKZOTnaK/A5fFhsziM8/b29MvhPxbpbzsHwuVVsdvMsPQkg15OkWR4BLQhsZlRKAuOvmvSt7J3l9EW4PSGIBkFoaB3gXs5fL/+Gil+g0Kh+wucV9TW4iVPgw0w0uAqoFT04Wv2g+tLJfakEXAWGRL+ekFS1x+xHSBM4DV04N8tWp0C2fBNdYfwNKheLK1Nc09qP+7tvGI6viqb32HT9HuWYSxTY/zgKgmgYUKDTzxUJ/1xXFxFk6NeYBYbWdwyKi+ypULMo5UD4kFF2H7BBXY8ZYVTjh8HFu+hBdX9X44LPwGkoBHVubvc0AKOSACWuem+tU1p5ML/dgb51CEwR0KrRHn+D44AGIcu0W5B/iF/GccNHBkNdGoBgBT4InBcI3IFcDtdjXSHt3QZcKom7LT4EvD46egJ2wnUnMeyYgo2tpbFotc+WnG/YYtVCsSlpZ8RzXh2UVRN9b3CkPd8KZnNCVA69ZwzkqDuBH/kFk1qynFsgIo3A+fzbd5vo86gsxyqVsw6r4xt8LHh5wWAfb07fpCmR7EU4z9RLxuQgKvPou15J46CH9DuCPMdQZeqL0Hl78u3nZ4b4axlrCzNrc0Up0PVZgRxVq8SG04hzAXgAZKPfHl2q7rqcYMNW0XwDn+PAB8xDdUNSVRfCNEhFkYnGi04C1fYYlmXy4tjCMLELdVPXChLUGYizINR55Sb70RUSZGcpKSWVfqZsxbOuNdxhNNZrgVesUZqAO6uhS6W4aWdaLk8V6CZtoggmDfPFA/+jABTNvT9k2FxL+3eZqXJPfRxwAaIkioevoduqLItLr/w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR06MB5624.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GbN+OrBG56hYG17bin0Wo0Xv/C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4vd/+9yFospiZcsryIfQtbLtLy1aPbe7/BFH7ZAT1BBR0tSgj1/e5iPH200EPIe1ei/tYRXDAsab+dRXIj+HQE0bm2h0f2lz7dmo8ij6LVrN6YznvUAXVgVzMai1XulOr85jXW/CkCdBQOxt9VI6PB/itI2zeYcFMDRFq4Gl/i90B3N17UEb75+4PiObsRa17tCLI7ohiZYbHqSrUBYzK2ClXInLSmAk3M4n6GndFdegaFYmS9LWk5yTEtSiLASGSo/qcI/NPOcV7D9ftJeEXwV5olPbjSiMsYp1/UQntBzmeUitH1MIKgekgZeCYp6GvlSWnWFTCJXdcxgS1HukGijVwXD7kzAFbq+A9/ySI4ilIXmZUNX8/ACWaFRpekp0r0LGadO/rltiU2EVoCboSQAgKL8KL3maQOtX+VqW1fFjetq/PQguI1AU16yq7lBJX7BJPLwTm2d0cxYPpf+POmBzwm0GNtDUK+Fopo/Duh6vt X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdd17397-f1f8-4431-60f5-08dcc5a87ec8 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5624.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 08:24:25.4239 (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: gR7IY8h0nRJzHAXgACAO9NLfQqnoyeMFhIsXUl0y31ns1XM0QynmGvx1BC6UX2zcD3EI/gplZ3+PPwkMS7WbnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB6665 The devm_clk_get_enabled() helpers: - call devm_clk_get() - call clk_prepare_enable() and register what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids calls to clk_disable_unprepare(). --- v2 -> v3 Fix the email thread. --- v1 -> v2 Incorrect usage of devm_clk_get_enable() should be corrected to devm_clk_get_enabled(). Signed-off-by: Lei Liu --- drivers/usb/musb/mpfs.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/usb/musb/mpfs.c b/drivers/usb/musb/mpfs.c index 29c7e5cdb230..ce6ad65c5fd0 100644 --- a/drivers/usb/musb/mpfs.c +++ b/drivers/usb/musb/mpfs.c @@ -159,19 +159,13 @@ static int mpfs_probe(struct platform_device *pdev) return -ENOMEM; } - clk = devm_clk_get(&pdev->dev, NULL); + clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(clk)) { dev_err(&pdev->dev, "failed to get clock\n"); ret = PTR_ERR(clk); goto err_phy_release; } - ret = clk_prepare_enable(clk); - if (ret) { - dev_err(&pdev->dev, "failed to enable clock\n"); - goto err_phy_release; - } - musb_pdev->dev.parent = dev; musb_pdev->dev.coherent_dma_mask = DMA_BIT_MASK(39); musb_pdev->dev.dma_mask = &musb_pdev->dev.coherent_dma_mask; @@ -184,7 +178,7 @@ static int mpfs_probe(struct platform_device *pdev) pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) { ret = -ENOMEM; - goto err_clk_disable; + goto err_phy_release; } pdata->config = &mpfs_musb_hdrc_config; @@ -203,7 +197,7 @@ static int mpfs_probe(struct platform_device *pdev) dev_err(dev, "failed to register usb-phy %ld\n", PTR_ERR(glue->phy)); ret = PTR_ERR(glue->phy); - goto err_clk_disable; + goto err_phy_release; } platform_set_drvdata(pdev, glue); @@ -211,27 +205,24 @@ static int mpfs_probe(struct platform_device *pdev) ret = platform_device_add_resources(musb_pdev, pdev->resource, pdev->num_resources); if (ret) { dev_err(dev, "failed to add resources\n"); - goto err_clk_disable; + goto err_phy_release; } ret = platform_device_add_data(musb_pdev, pdata, sizeof(*pdata)); if (ret) { dev_err(dev, "failed to add platform_data\n"); - goto err_clk_disable; + goto err_phy_release; } ret = platform_device_add(musb_pdev); if (ret) { dev_err(dev, "failed to register musb device\n"); - goto err_clk_disable; + goto err_phy_release; } dev_info(&pdev->dev, "Registered MPFS MUSB driver\n"); return 0; -err_clk_disable: - clk_disable_unprepare(clk); - err_phy_release: usb_phy_generic_unregister(glue->phy); platform_device_put(musb_pdev); @@ -242,7 +233,6 @@ static void mpfs_remove(struct platform_device *pdev) { struct mpfs_glue *glue = platform_get_drvdata(pdev); - clk_disable_unprepare(glue->clk); platform_device_unregister(glue->musb); usb_phy_generic_unregister(pdev); } From patchwork Mon Aug 26 08:24:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Liu X-Patchwork-Id: 822643 Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010010.outbound.protection.outlook.com [52.101.128.10]) (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 5911F13A88D; Mon, 26 Aug 2024 08:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.10 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660696; cv=fail; b=HbNxRZwYfWEN5V6lU2I1GXFXyGfmg6Q0PZgc1ABz+XnrZDTgywux2SPgF0j1HQn8A+cLZf4zv68p+ZfGI3hOt+5lMl3JHkVMKExjG5KmHPqXN9Ipzb1gbCJWzcjO1p/EwnV+qkcTk0r9bu1sUWOA8koIcUvAhwzb0v6JbkohKbI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660696; c=relaxed/simple; bh=lhRHKkMsCs+VvwNGI1rWlr4gSdEFi7M8sMUhMg/oDmE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=g4kr7keWq3PXYuRwc3PcR2mI98IcXnqQLexsC6qZiHbYa+GXK9uDmRWuKdky97qWK/fSNFdXvKnlU/Pk2P3VTWegACYMg3GxwtoVGL+3wHuIVRNpI6KANCwZfWeiL/MWcSdC/W7p/P/dKaGynuNutjGHr1D8lUj7Pu4/iKJOHRc= 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=IFWfaGEt; arc=fail smtp.client-ip=52.101.128.10 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="IFWfaGEt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YakNK3PpVR/BOGYOMKqFCeZsRE1XBqxvQGvIWcVWBFCXitmuINJfkpHG/PAl2GJ+JhK8iBzlNbxpO3zyKXngcm9VHfos4Q9fHpYwM6rjXKWUt74PQJ4VdTSpKWHMmhlhEgYjIGsTfqLKxfE6PVQCDSp7OeNvmi9pF4Qi6u7fJdwXETQWUL/kbCdDAnM6l39GGBg2ArQqef7oNDB3Rf9ab22WJaWBzcy2mphsQg6LqielheRtS0Ub1OTdQ6ZdcDBq9vEewlp9Ox2l5y4En0Snd/OAZkOnnDb211uyhUBS20Mr2O7Q6Pf7xxL22Va7jvJGmROoRX9NeRZv00/pQSsxQw== 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=qePtTVXheWDxDk8UnTBh1LVgdspIxgEpskAK23lNoW8=; b=juOL0wDgcLC/R6zF16Vbahxlz5kRz4ARU4XO33OK1xzisQSXfSo2qTr/vjFlyN0zBNGSmULoBvJRkTDrMXV9gGxhwfP44db4qgvgxM01VdzdxVWIZJpyqE2qXnETzwxRX8LBUEoLiW+t3df2Q2n0PLLYogfmnLiX3q6tuF4EyoiJX6VqBi5PSRp57ZQnpBn5vGUx637Dz73hdd6lvLKPyxv74P+LYtOQVZljR0Khcq11uxOpKL3J5hWj/ve6+pXZfbe8PpufoOkny7ARIRWJKxKRMwDqDr30XYhTOPiAdFSwuxC7zNn9wbLVb1z5UubUsrDzCg4x539/8ChnIZSoWA== 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=qePtTVXheWDxDk8UnTBh1LVgdspIxgEpskAK23lNoW8=; b=IFWfaGEtzZxDo0PiDKSk3EtLBJ1uCwvqb5/I5FYdsAQbJ3anYzNy/RkAosJvWWW+ZNrNBjZohoR2o4TDaPrgy0Khq8uQ2vHy1aJbBuB+ve+XxjwziEh+tL4ZdmUuh4QqNa/9BlYDsUM3jY5GqQW5nPsvjOApvWW8PO/BLqjN2uMmxoRUEoKNnxXMWQAOOvXnSFSDlZ6/LOmcJdh9ZTMKz6u9LuRNTrxxfaUSvZpCoK2LherNNy1t/VoZ2rhow5N8uC9zYJ/1jGqktGMwdeb1uMjzwFeMdU+zG0dZ9CVoXXbAF+Tf/3S0vIT/nII4TZrGzPXifwsLsCsbcCPnwUU26A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) by SEZPR06MB6665.apcprd06.prod.outlook.com (2603:1096:101:17c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Mon, 26 Aug 2024 08:24:51 +0000 Received: from SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd]) by SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd%5]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 08:24:51 +0000 From: Lei Liu To: Bin Liu , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Lei Liu Subject: [PATCH v3 5/5] sb: ux500: Use devm_clk_get_enabled() helpers Date: Mon, 26 Aug 2024 16:24:39 +0800 Message-Id: <20240826082439.2393-1-liulei.rjpt@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826081900.2284-1-liulei.rjpt@vivo.com> References: <20240826081900.2284-1-liulei.rjpt@vivo.com> X-ClientProxiedBy: TYWP286CA0023.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:262::10) To SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5624:EE_|SEZPR06MB6665:EE_ X-MS-Office365-Filtering-Correlation-Id: 86c2b685-0d2c-4e4d-e7e2-08dcc5a88e31 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: Nw+kp9eV20Z93wuZEIi1ecuDhXIul9qj+/vjvvYFyTqsn7e8q906t9zfOmYmaFKmNOvFQzKYaoTCTBCjJs3VmIDxCNcQ41I6e25XQCkBv7hVSj3zWNBIGJ6wjYZnDQFcvaTbvYJUcnjeZ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k1GGkvrsSRxnWeLzNHTVJTuU6HxVdNc56t9/QFED+1cCbghTZQMusZDSsU57t/JnQevS2qTK+ZU5g6EnO96GjJf3vUO4fCEs82TBAiU+VpE3qd0xXbJ0ahLE+WFxChKQs5L6sqwF13rW/OShhs67S66KkU54UcEC4YcCjZ4qnwfhtmQC3vlb2duQ9LtsinO4uFY3+aqyNsQcVLsgR2MMcmQrY3A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR06MB5624.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rkJhB8QEIMgbxqS6PF4QEvHAfxkUNpDfeKAi/yzsVR2Nf0/FuizLhCJTGHEkHrcpLTXNKpZKLQak/VEds5ZtB8am0rIGZv7n8OqwqyoteJXQ6Qz7by/B7x7LgF5ZA8QCt/hWslZwwfII59Y3DqudqrFisrHUq8IcR/NanroYOHr+n7w8RzNVgk5Zw99k3dtG3Wh/Q6t+1mcw2kVZ1BYfUWfxmUU/Qsbo8Yo1ErF+87IJfl5FNgT+yPxb8SWLD3yWS6a33uLp4Csiv46BIr8QYotJGKAHg4H+hTEK1MJ96EbVVRKo8ZDSKKNcOU2D0hTEyUg3wgyWXY5G7b/jiBmUkrwd4u4btby0MQAD8ku2tSofHJQdD3G6GuXifi2ONdw4ekrME8uGgyl4bMT+n//9EzueYGpVRd/8aRzrRcD3yIwD2xXcHFI/Lrqq7Ic4w4xu1Rc6Nvr85KKR3gftNa6ttLy3edzyqFp8dTmkwdajIrm2NEpE9NNiTCd0YwKp7U0wL04b3+P7C4/vMNc6tw10dJ6a7ro4nPtq8EcCqw0IFAi5LpZzHlV8hdSSqZtiicqrrpCuhPYHdZvOGZve2oQx+AXSl9raZfjNSFPwx6xMmds2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Source: SEZPR06MB5624.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 08:24:51.2383 (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: 10Oe6WiQspJF94UgmQS4aWfezEiqO/9LhOzKcKzjH8QXqcVXffTJKzWp+/BsS1adsvLUyLl5szhu61jhgoB1kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB6665 The devm_clk_get_enabled() helpers: - call devm_clk_get() - call clk_prepare_enable() and register what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids calls to clk_disable_unprepare(). --- v2 -> v3 Fix the email thread. --- v1 -> v2 Incorrect usage of clk_prepare_enable() should be corrected to devm_clk_get_enabled(). Signed-off-by: Lei Liu --- drivers/usb/musb/ux500.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c index c8d9d2a1d2f0..3be00227a6f0 100644 --- a/drivers/usb/musb/ux500.c +++ b/drivers/usb/musb/ux500.c @@ -246,19 +246,13 @@ static int ux500_probe(struct platform_device *pdev) goto err0; } - clk = devm_clk_get(&pdev->dev, NULL); + clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(clk)) { dev_err(&pdev->dev, "failed to get clock\n"); ret = PTR_ERR(clk); goto err1; } - ret = clk_prepare_enable(clk); - if (ret) { - dev_err(&pdev->dev, "failed to enable clock\n"); - goto err1; - } - musb->dev.parent = &pdev->dev; musb->dev.dma_mask = &pdev->dev.coherent_dma_mask; musb->dev.coherent_dma_mask = pdev->dev.coherent_dma_mask; @@ -276,26 +270,23 @@ static int ux500_probe(struct platform_device *pdev) ret = platform_device_add_resources(musb, pdev->resource, pdev->num_resources); if (ret) { dev_err(&pdev->dev, "failed to add resources\n"); - goto err2; + goto err1; } ret = platform_device_add_data(musb, pdata, sizeof(*pdata)); if (ret) { dev_err(&pdev->dev, "failed to add platform_data\n"); - goto err2; + goto err1; } ret = platform_device_add(musb); if (ret) { dev_err(&pdev->dev, "failed to register musb device\n"); - goto err2; + goto err1; } return 0; -err2: - clk_disable_unprepare(clk); - err1: platform_device_put(musb); @@ -308,7 +299,6 @@ static void ux500_remove(struct platform_device *pdev) struct ux500_glue *glue = platform_get_drvdata(pdev); platform_device_unregister(glue->musb); - clk_disable_unprepare(glue->clk); } #ifdef CONFIG_PM_SLEEP