From patchwork Wed Aug 21 12:10:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Liu X-Patchwork-Id: 13771296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C58BEC52D6F for ; Wed, 21 Aug 2024 12:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Gfb2AhB2LwAlAPmLjmlvviESVB64HIKoWVHQRdIJ2hs=; b=awPqqVr+QIKH+2 SKJIFxuLiNSyM+0Lyp7ea+kQq/ffU7k07BZrJykPr5ZDs7+lXRXcGz1lhS7bgC53ACjq0+w0e04W3 JkR/IcODymqA+iIHWCXh1mcE5sAdaRMpZtEzCVR7HZioRhdrCKXzgv0SPyW7nZTT8H8NNoYCfSmu9 vPiYEiRyRU8uNAbiphRz6nro7EhwWQPsoenHGrIanDotZtjBfxbT/x7xm1QJxhAAc6TP2Rm7V1xqT Uwfy8cazIGExMn87CDvhoYUO7n08wr0SwWx03axH0uCulhBthSR0F9kx6+3tKmZg+TrBwBjWyyAtL rIQVH8DEYu1mpguugBXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgkEO-00000008sGb-0ck5; Wed, 21 Aug 2024 12:14:28 +0000 Received: from mail-tyzapc01on20601.outbound.protection.outlook.com ([2a01:111:f403:2011::601] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgkBQ-00000008rJM-1TT3; Wed, 21 Aug 2024 12:11:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b2BH/4odMp5N1Nlt8AQNcS4w3TFfNWMMCSJvh0P8a9qerxOBPHFIL4VQ4fOUQ06P3PRmYK2MZHoJscQPYQ9B6qyYNpTNnsh/XX0WXyudp95b9gNAswf9G4zDMbD3p9g6gP0zsfQ4CWHDTkI4Mt8AhjbAGDUmDMiAFslk3vNN8RDk4NyL+2Zvi+/JP+fe3iR/hxrR4h+sPlu7Qr34/xxdI6g/fgFiN1IpaO+TwzOqaI0FkX0Ds95YQ5SQo/WxUL1KjJuLFfDfLN2z1o43wLiznDQsSb6SKuZfPeaqDiLOdfCkUGdXV15qRlTHSkDcb26lwaTCH90QgpkPjhQfYagptw== 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=bBLc1uGom2+Ec7CsEI6xiLjlWnYrDRNdD7beWn6v33o=; b=ZrCnZB+QqLaIUWSQmUaBwD6BeLVWtxFF5SYPYMUoAy6x0II/mvtRrhymc79zO3wzZ0d0dhxeaxwXHgwe+FpaZG74MFIWhXXLXFaKRLP2tN1jnIWYzrbyB8x9w7Uw1UFYEIbmho/YEM33lDILK0Z3R1cxHMnC/03uhWNqVMrY0uXREqWwgzMvzpjY3Gs7XNfeaaxvkzQzrAWcNmGxuBd3/AqSC8hG/uxA8BqKQeHc9M7oqzwcNHB7y8jM9yYE3nSswKyZ2bWPfG990f45xduxwbrf+3fpx/EG6/HhZ2JvWpiIwQD/u79m2NYGdggpC9m3HT3i0xDrEosiCV7y4DQRsw== 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=bBLc1uGom2+Ec7CsEI6xiLjlWnYrDRNdD7beWn6v33o=; b=BYm4nkVwgHTwFWbc2+e6Zs7UMgkp8nL0mofeCT6tMDu0GqhqorWoPuA5vitDX2VEUgD03uknfJF70uHtF67+GqhoCdEoc6JtdURFeXGG0hYF+pxqmGOveEkrRfv9p/42MxwFp6eTU5KP11sT3Oe0QgJ7rpi19wn8w3l2iYp30Fa3ToB54FGG0OItlVJbxT6T+Y7cnKWDeBQBRVOXcj78j2BtYKW7xuRyS/i4snkILnBEDxDn69YI1IBLKZrQzJe/u3PWZa8eAVbCoCsPGyIRDP3yvB9odSg4AYODbZ84E6rthWuQendNZ/qNgZOFF4fK7jsGD7hRq/4xPMK7pgHqYw== 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 JH0PR06MB7128.apcprd06.prod.outlook.com (2603:1096:990:8e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Wed, 21 Aug 2024 12:11:16 +0000 Received: from SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd]) by SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd%4]) with mapi id 15.20.7875.023; Wed, 21 Aug 2024 12:11:16 +0000 From: Lei Liu To: Neal Liu , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Conor Dooley , Daire McNamara , Bin Liu , Lei Liu , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-aspeed@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Cc: opensource.kernel@vivo.com Subject: [PATCH 2/5] usb: pxa27x_udc: Use devm_clk_get_enabled() helpers Date: Wed, 21 Aug 2024 20:10:40 +0800 Message-Id: <20240821121048.31566-3-liulei.rjpt@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240821121048.31566-1-liulei.rjpt@vivo.com> References: <20240821121048.31566-1-liulei.rjpt@vivo.com> X-ClientProxiedBy: TYCP286CA0069.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31a::17) To SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5624:EE_|JH0PR06MB7128:EE_ X-MS-Office365-Filtering-Correlation-Id: a8499f9f-c4d8-46a7-30fc-08dcc1da5b4d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|52116014|376014|921020|38350700014|41080700001; X-Microsoft-Antispam-Message-Info: 7WRG9CcCciQKRe/l1OhZyVkEc7+43XVM6AnuCvl62GCu2aRMrt4tE7tNbQdZCql/vi91xLdU8/3+PxGT+wa3ehUmev6BTufZVY2NEyhG8thxSLYJDNh6yHHm8moB/jrRjRb/eTpBFlqW+3zB5He9rZmt3y+Do/wIemF/6LIktVAGT8hx7eA3D6TO4wclcleT1HJmRAQ+Np6lP6W/tQbLLycYCsCbHvOqIVZtQxCz4Qi+TVQwtaBpJwhcT5KDLVljJCuSrUp7J96RKzkWYHu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fOQ2/kZnGnDtQNU6elw86fwOsD7mQLWCk7J/L68/W4ZxC4nlKcA9QEqLfuc548WkvNWmBr+6dCCNQAmhg0OeFVEKxAIDa8qwYPgJYJFQV/HM6yZg5la150uA0sq 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)(366016)(1800799024)(7416014)(52116014)(376014)(921020)(38350700014)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9fL50Y0CQUpcCPwtF44Kj8BMAd2JeaPowzNTh6JXuC6zBRCOvqa9iG9dlT1oGJpIrhSQyVPLN/bAsnBIb6Lv0WMdZhCtRv8zF0jQlsgvcG4pk439XdS9JGEQmreByfLdQS8dNV470CYK+XBqZUMoHP9/IyyfbVVHjIa7V5DY0z/6uC13ylO9kbsxAFLQeAkRHP15Otm2YnXh5fCyFeVNGa4qGRC11i65wFbvuVycincHNzqaOwTICpBT6Pjh5NrVJekyLbmBEBq7IM3SZ1rtX5hC4WdTMbWlDik7SXAylgTX7qj5iCHinQJkGEKP62SjGg4X1jkqTpjFrEMcT4sq1s+lsONGL5THTPDjRTHoWo4DyFl585Nnuj2zTPZ3x3YajJzZymfQs2md+DpVzPzxTeetOnROb91jbDphibuZqaxEiJROeek5t8ospNxOWpVQqYFRM7kBx7+r/YMczAcWCusu70YzcGrbaJfVv8TTS62IwKOPBHotSlfPD25GVJs1w+5X0WLwRe28xcg8FJbPI2xI8F3aoVjuAHwPiyvyMXxaHyhdd/k7ISqeqwk0ozg0GIUQWq0G95f2hOm+jdhOtzuyGZxRVVpav7XlBsGHBR7pQ7GcSNw3Cby9DzHJ3f848K/N31W+XH912bT6VWRtZiDh+GZwobSPDv2zKKvLKTCwKRSs/mhCEx7QxvVdOW/EeVqhVIJihGR3B4w9AD4ojwvFIx/gbkvcn1NgggPi6JV12ounnkEF/q+9Mrk0uTsIISxnPXPvppLl75ORFq7A5lTgqbHNeM0JIS4vc711JLMnrhwf9R11UmN8Q8CZjzs1m3Vfdsz1w2PPiX2o/GJlX2n7breLlrEzADHR4DrtOApqbF801wizP59TEciTqpXAoWX3ZtIj8H8XHJVYUvfxssHJfXXJQQScSXNQjmjhu3VxJoqm030MT3QxSWAM3EaGJWdgiJN3UBQXAnltH85WZZ1p+6yvLhqhxGfW2vDv8N+12vjyOXbd7velk4N/qrbJu9pC8CdFNYw0lCLQeIEH0L/tSN3bBrCUzEpTvH48QJjD+u9rM12/ZY95SteVwRFmMmVCcvnbuhRavWJ5f6m8J2UJQmoiniu6S1qQnEUdM0O6+ma+e8kcsuyWp5cNO+LL4QJSQDB0gqqZ/JPbHTP1ZxALoAmWapBKQfPz9yytH6zzUIo7pLtDSzSt0aBWcNOR4/9Ka8zKsM/RNpMlwFaxqIAYfgFS5cwG1BFyS3DHRoovVvupgR4w96H9E0J17vsTY1N6heNCGnhcagID3+D2DrbRRQcNchpnT89Y8dsphS6UONHk1u6F2+2fKBhjOydl9UaQLnas86j2vlUVRDU6kG08WVsJ6fTbCC/2QLkyIYgOq2EDcbZrdJCOMmRMdnc3fj6qMaPhedrP7mXAOXvuuTU3fiVNpzKQiNBPogvCLQd30YtrQ8cdrdRFjio5EVFHE0cTAQBjSH7H1WKVb2fCK1VfpgmYUdRlfLUIJa/zq2xadX1SddnGFEWO70Ck2FJfGZEOxSmRt7lxo1pW35h8UOjoqQHAFEh4GSAuZAeCxg0uOkVr4YfoDF40eYqgzitE X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8499f9f-c4d8-46a7-30fc-08dcc1da5b4d X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5624.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 12:11:16.1087 (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: GJTKQUcd7Sq8UMJHMpp91olaq6Z2dzT8ME8uJxBdl2+usresG5qzHs3WL2pfEvds7Yz2v0+4ylkfpT0bjnYKsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB7128 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_051124_413501_BB7F78D9 X-CRM114-Status: GOOD ( 11.48 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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/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..6e99e75f1acb 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 = clk_prepare_enable(&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;