From patchwork Thu Aug 29 07:22:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978270 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.a=rsa-sha256 header.s=selector2 header.b=ixISaY8P; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45d1:ec00::1; helo=ny.mirrors.kernel.org; envelope-from=linux-rtc+bounces-1759-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [IPv6:2604:1380:45d1:ec00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvXmv1nz4z1yfn for ; Thu, 29 Aug 2024 17:22:55 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3BD9E1C23766 for ; Thu, 29 Aug 2024 07:22:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0AB5176AAE; Thu, 29 Aug 2024 07:22:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="ixISaY8P" X-Original-To: linux-rtc@vger.kernel.org Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010048.outbound.protection.outlook.com [52.101.128.48]) (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 B627716D4CA; Thu, 29 Aug 2024 07:22:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916160; cv=fail; b=LylFVNKt+UKCXyHASBKKbq9NskwpDpQXEx1y7q5icSHDrT/r8y70s645J3zH6MtVqzq9ebkGHFvScs7pSwNJM6XcUWjGRiEhfLz7WsPcWVeUHCMecaaQLnSaF5d1r8Jj1l9lZfJSxddWn7j1TAcrhkFguj39lSLdMsd93xM2LHI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916160; c=relaxed/simple; bh=bVEEBr4ewNWxP0v/L3lvL1Vdj/Q7GZjpzFEisYNxeuc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UcZkH4qFFFt4mQqfguPyDy1OMdR24B32w84CDxKjBUMxOgHv+Yt08tYqcBiXLkOVyUN0XXUdwr/WVwnl/jZI8pNyW6Au+1JOKUPZJVInzai3N/OmJK9Xm9Tn/YLZcx8vN9rHwQYH88VM+wRwNRHC669vWpCe4f/3bOl5NbZNMlc= 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=ixISaY8P; arc=fail smtp.client-ip=52.101.128.48 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BMcMue8LVVLQV3rwFUJqoPHbE2xgbo2ti6ZPHu806dSQF8gD3nx6zkCZV/dMSpCV3lMe+Wat7OSrW706nxQPfWh7awf3mL0L1BJhy5B/6+MDimxwYaQft+IKyFB8hJDpJWz/K6lLbhg0h7liMdGnBX8CW5jr1cQ/UULS6fP7yVGCifkfyRBbHMJTMpbuN4Rm81AA89qLeJy2nTvIBjPkZ8X60xQaLw9VbMTOlQZN5RHURpye3pTSXbi/MXc3p8z0LRCJMdzugNiScKks5hbh997Dox71SNpF7ntN1CTXZJUxOJEXDMB1OWQLDL0zoOV9KnUEItLWcbjDQPA7kSny+w== 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=hyt2vWOi7reV01AQW/h9DbbUrfax/jMVPV75+z24PTo=; b=B+2TJrHCUXof2vjRaJWQ3U/z9mHGOEAoIK7yALIBpe17gbx2zi4hUwQ2SKMc57pM2efZLG7+eAhCtTIonPG3wu7BYTVlmk/9EYz+O/YnRmdgHWJCKnrCAkWup14o8FPp0kCKY20iYlsTwCsKIFiBOb1P33aeAza+s+S+gZFgGicPytYD2mWm5biNGE0dPVQEDY30HUhcjzZKtxqljpoAJestVEe/fI5KaQEpFkP5WxyVpJMB48yMUy+1gijYD6NtJWdmBfd7pq8Lat81RCY7WbanUpYRqVUjwxdyY1puj6WnODZFZDJF1MezvLqSlMLQL8AAZdZC/FKpwLo3bt7Xiw== 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=hyt2vWOi7reV01AQW/h9DbbUrfax/jMVPV75+z24PTo=; b=ixISaY8P+kAiPKlVhi5bgK9JCuVLOsP7TMNS+6lS0bAgySVC1TyX0C9EURwyq3UeKw4zJKKb0uhkRppzgcZn67T2Xu1aH1FfgiZe7wdwTbGjiFwusGUtVskIMmcHCt2JXBIiEXstMfrg3FHn/6TY8hYcRmZybz5MEHsBQ3uxE7okmKyqQIwoxbxpMEr0wU/WCTONeL0pSp/dPHRG38upVf+0QX2vI6lghD4ZsLV0pXBqxvcoMGc6Te44IUZF/TCfOKoC6Zy+fgkeJZuGVbTw4atbBSAC7L8IpY6HFF0lF0wpWRGCmt81ci4BkIwdb2mw0K4Z8+BWFhQqTnLEpFpKdw== 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 SI2PR06MB5172.apcprd06.prod.outlook.com (2603:1096:4:1bf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 07:22:33 +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.7897.027; Thu, 29 Aug 2024 07:22:33 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v2 1/7] rtc:rtc-at91rm9200:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 15:22:03 +0800 Message-Id: <20240829072209.7253-2-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829072209.7253-1-liaoyuanhong@vivo.com> References: <20240829072209.7253-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYCPR01CA0010.jpnprd01.prod.outlook.com (2603:1096:405::22) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: linux-rtc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|SI2PR06MB5172:EE_ X-MS-Office365-Filtering-Correlation-Id: f13048c2-240d-4583-91f0-08dcc7fb59bb 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: mZq+1ZHB7Fpad5uAH3HEci1Grnjf8dRq1xHijmCoH+4nd+P/9zqDNsucLfECkrjX9vmJYPaMhSL2DXsNKap9BfZGNLdBigFphL0V8JMvgW2pEL3dzp8vQSlcvJxKL9+cYX1KLwHqaxxxCvHETWGgFj/yOAplyAtjSgtSjlQs/L35Ds4q+ZvwYcDFmPGPClE20hvvLBevR9d703/aGHVLTl4oaMhneqqOYGHH6FJwOLzw3ATXq5mMUBYiTZ5dzGNHoDi1dj506mb1ZR+VwW47a4jA3/8h9TL39wWwt9RQKWS2A/sSpUQMj9cTo9aEJI+RgMVy969C16gvjF2SKhMxgKglXe2+Tm3kvLrfxNIU00EgRVmIoDmL/5Ip38GJkoUBuCqUiW6b7UgIz5LFnXNZlUW/KaiEq44TH4zzXXHZsxhEcOG2m5BI+ePH6fMi5b6ZJsCgVhG3eY5c+vRSrpZW0HZCR6wAhBI5uIEl4RsXWZoFkWCupaUAr7DIyWQP7EzhYSlaxc+AzFYo5dCCiKyKl8YgwDR3w0wkSVQAxDMKq8XiOd2uKCgYxyPDsq+QLjPwy07wvAcugI4A65pDW0kzkLf99TsGMUFUA+t4znbF4u3ThQ02aIIwNegRpL0kVfg2+quNbq+/pDJyiXEGmG96hDK+VJNuYr5n9sw4DfsIOODBR4M/d8QX6CetlKEUCipm9nmg2NO7ixDXU6geW9gTynrg+OCwtVk2jcp4O2CTFCkwLEqqHwA08z3e7cK2ifyNgkafasYCDA5pz6RiWQ+2puzqaog7ggClGJLL75wnBEcYCEmfneDs2kwUGk8yyUxi4jFKRQ87GWQXjE0Pmzr230jIIONuUXik1vk1gGc1SRJyrWpwzdR32f9JxHpfWWCWit4JlqhOJp9CunxxvfoChBWczDUhS0hIDYASpjAwnp9Qv6R+NwOSasqMxuhnp+d7llAIXBhEjN8X0oPtH7NxUAzuJKse5XlvBdE4WQZX3TY3PdU8W97ww1EtJbV1x20iAroBgRp0pfKuhV3xOlb+YdlGyu3B4xfYinxEI03yNSNbB8YGYluXkDHiEXXNbCOpa3HynxRi2wHnm+cmkW59q/bakEVM0msOje4atW/RD1Qo+RNXqY9tUqw2+xYlo/CtxbworxcVndKnrjHHZToez3Dfq5T+gWmkvedtQnR4BbAZJjaEQlPFaqiSYmhlptVjoXbHd+7lGS/timkkdM6NEgPVw391EmohlLcQdes/86G61MuF4ikfNmBXIZ3I8lFtoYzwca1HkXRscYkseRPDn3QcWRgn39K+oF70iV3HbwdpjSXP19FvjznMq2rtJTnZDP7ElMLN3TNuYUk6lbKCc3//KoCLlZWV6swDpnn2YruE02WinrVxHwF/Hg4j6mod4qCePAkQDamvHe1d9Kk/SQ== 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: 3JdW/OQLA8ek/iosJRuYbqL3pLY9EqlWxgH1GMzJFbYuIdJZYB6vdjPEqaAhlYE2A7GzhMnZNRg/WuC2t2Aly3Mh9uz+tOF27onlDF/yAnlwFosJdWvnpb7XpmQFSwhl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FCEHp1wEs0VNY2RKsnfcG8JxIrcWf8kwfYZmpMC82/gsXnSB5FJlqUIt4zHk1j+ytJoL/+GJi1978T84vgklPFXO1XKbFmW96tZRAEe/N1ksw0Xr5RLqHk5nUrffphWfooL6wdBOn0cXgJr0QMzyJ/xisePkoIE5t28F92HmrV36UNe4d2Ck750jahSEcysW5yXwAIg652kyUZqT8HmBDbh0W9IXLcFjNgJO7mXu0JhwX1hZEm2B88oAk/eopGFWmlQNoSrAE4SqK1scpGszvwoIkUC71596qpb7V9YBeJgHe83UPzDm7wP1HLOE9//sbCjM9jNmu48/WLKCGwr0O0ixl+F1f8NytkISiInWxlPXPLpC2mjHIL8x03SWv9/wZJ5ZTpc7x3ThHpa+QhPA1p X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f13048c2-240d-4583-91f0-08dcc7fb59bb X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 07:22:33.8051 (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: S7xzlfJ733EY6WfzbB4DiTtzPCdTk0oOJ4FW4umYElJP3u2VXQirYdXu2V6+/SzixFBugmFV4dtShOCUjJmcrw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB5172 Use devm_clk_get_enabled() instead of clk functions in rtc-at91rm9200. Signed-off-by: Liao Yuanhong --- v2:remove the global sclk variable. --- drivers/rtc/rtc-at91rm9200.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c index c16fe711a0d9..4d909b840515 100644 --- a/drivers/rtc/rtc-at91rm9200.c +++ b/drivers/rtc/rtc-at91rm9200.c @@ -104,7 +104,6 @@ static bool suspended; static DEFINE_SPINLOCK(suspended_lock); static unsigned long cached_events; static u32 at91_rtc_imr; -static struct clk *sclk; static void at91_rtc_write_ier(u32 mask) { @@ -471,6 +470,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev) struct rtc_device *rtc; struct resource *regs; int ret = 0; + struct clk *sclk; at91_rtc_config = of_device_get_match_data(&pdev->dev); if (!at91_rtc_config) @@ -498,16 +498,10 @@ static int __init at91_rtc_probe(struct platform_device *pdev) return PTR_ERR(rtc); platform_set_drvdata(pdev, rtc); - sclk = devm_clk_get(&pdev->dev, NULL); + sclk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(sclk)) return PTR_ERR(sclk); - ret = clk_prepare_enable(sclk); - if (ret) { - dev_err(&pdev->dev, "Could not enable slow clock\n"); - return ret; - } - at91_rtc_write(AT91_RTC_CR, 0); at91_rtc_write(AT91_RTC_MR, at91_rtc_read(AT91_RTC_MR) & ~AT91_RTC_HRMOD); @@ -521,7 +515,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev) "at91_rtc", pdev); if (ret) { dev_err(&pdev->dev, "IRQ %d already in use.\n", irq); - goto err_clk; + return ret; } /* cpu init code should really have flagged this device as @@ -539,7 +533,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev) rtc->range_max = RTC_TIMESTAMP_END_2099; ret = devm_rtc_register_device(rtc); if (ret) - goto err_clk; + return ret; /* enable SECEV interrupt in order to initialize at91_rtc_upd_rdy * completion. @@ -548,11 +542,6 @@ static int __init at91_rtc_probe(struct platform_device *pdev) dev_info(&pdev->dev, "AT91 Real Time Clock driver.\n"); return 0; - -err_clk: - clk_disable_unprepare(sclk); - - return ret; } /* @@ -564,8 +553,6 @@ static void __exit at91_rtc_remove(struct platform_device *pdev) at91_rtc_write_idr(AT91_RTC_ACKUPD | AT91_RTC_ALARM | AT91_RTC_SECEV | AT91_RTC_TIMEV | AT91_RTC_CALEV); - - clk_disable_unprepare(sclk); } static void at91_rtc_shutdown(struct platform_device *pdev) From patchwork Thu Aug 29 07:22:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978271 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.a=rsa-sha256 header.s=selector2 header.b=d3FrfbWq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.80.249; helo=am.mirrors.kernel.org; envelope-from=linux-rtc+bounces-1760-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvXn65mPWz1yfn for ; Thu, 29 Aug 2024 17:23:06 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3820B1F25927 for ; Thu, 29 Aug 2024 07:23:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90CB418801B; Thu, 29 Aug 2024 07:22:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="d3FrfbWq" X-Original-To: linux-rtc@vger.kernel.org Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010048.outbound.protection.outlook.com [52.101.128.48]) (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 CACA917799F; Thu, 29 Aug 2024 07:22:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916162; cv=fail; b=m/dl2duQxzXaoCrg2wB44VHRQY354+8D4HOPwN1A4IhD8UNpOFWyKqQWV2l7N3XJ473oZZA36eenMCqHjFb5Q1g75c5O91yTMnEp1hymVxnbNqUPHPmvnsRDNiTXFe3iPp9Oimtro2hHN7JlYiBW4Te3tCqZWlGgAflxi75myr8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916162; c=relaxed/simple; bh=IbNEFCZxiqwZqn/qeK5t2lXr5khkPyJ7Ke6mq16MIx4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=N0PYVjWlrZ0arMfL8TnEqfFBDGNFPRcBZiMq8gGI5Zj3u7OSGiPLdyP6gdEzoGG12RczGKYV/ZxtCZP6rXBUJGX5l2LpbsfL6tvCstYewP980lUj1QnECOSbttz5sG3naAZYlfxGa+2y5EZOG/GENaCPOeO7emRE6QR7BF+V1o8= 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=d3FrfbWq; arc=fail smtp.client-ip=52.101.128.48 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AtZByPIg66JbDZzf6kZA0Ed3+XAlKOeXgH8VkM/3uiLA822CMWHHt6FGfJfId2qmkRLGCtxgR4ToVE7XaJc4ZQhlK9b5rkx7mPGhk6z+Sim023b64SNRHJlj5QrpJ9cWG5JUsT3B1sdbEWM7ovhuOLcIY3o6K/SPweDc1Fv++CyCdhtmXZtCp5cHC388MlyadW/yJC7WJ1ZMcSXZCkZqsRf6gRctTf7xKdmg7F8JlNWna9KmGg0g24JlFxxQWwawgBgVYFNqpGreEwmOv5s3DWbRqaEd8MBIKTxnLABnwQrv22H5JukHtdCAUNKrPZdxeh1n3+fQBObQeBPxfmW/2A== 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=NADE9bwzc/fkj+YIGmvrP0pY+RyhvL/8hiMsQygvGBs=; b=UbrggsFprhFP93QVt5OKnGiDg4afO739fhosbIsE7TXEp4QuFz4cdbbTIkVhXkdDBzG+IWp6t/KLFDe6JRyviRqgZXxmA/q5qDRqrph0Eg1oXrnxunmvhzqiskJWHKAJmNM8f7z0aHYeKNJlodpL+45/k2HoSXBm63G/31kd2KJMB5k2heodX8ENwMdhnxJaYeePsfUnGbwvyByJKS5ig/2Ssf8/k77Iy2WWNxLehtiO2NP5RtQRmw4oLN0e+peWxIGfxfn7JUDzAHSQETt4rvdRWbyNYernJB/vXzfzG8UV5pAucboOycV40QdAhUeVyYFi8CpSb+8tbaQ4ktBYpA== 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=NADE9bwzc/fkj+YIGmvrP0pY+RyhvL/8hiMsQygvGBs=; b=d3FrfbWq5DX7sV8GqzgAtIGoD8MBMYaK8iPdw6LANsYbt1inGE3HM70v8aQXXkwXfH5yJPKRJpfNLwcpi3QCYrgvV9zo46M4PXaVKbHv9F++CSoeli6HXwb161EpYy4FgekvnKgSytkToIcrmJMfdmO+PwBqRp3pEriyPezVKv9VrpouuaUm3wQ1wF3btOGGMs9KAzxEdy5oUIjMIicshm2gjHtz2j9wBNQLNl8gt4wkSzau5bZM6pcgCDA4ZOuOO5mM/u4AJiajzlx0Xxb+sNLSaGh417jqEyoSkgs7zaNi/WBq0bEb5nZN7IKNLEZ5r3FdhB4tRf8NLjeGt3q5wA== 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 SI2PR06MB5172.apcprd06.prod.outlook.com (2603:1096:4:1bf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 07:22:35 +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.7897.027; Thu, 29 Aug 2024 07:22:35 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v2 2/7] rtc:rtc-imxdi:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 15:22:04 +0800 Message-Id: <20240829072209.7253-3-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829072209.7253-1-liaoyuanhong@vivo.com> References: <20240829072209.7253-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYCPR01CA0010.jpnprd01.prod.outlook.com (2603:1096:405::22) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: linux-rtc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|SI2PR06MB5172:EE_ X-MS-Office365-Filtering-Correlation-Id: 89db2e9a-0e1c-4e31-5031-08dcc7fb5adc 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: 6ahFBKT5BdySh0K29pRtkuSgHgjRDIATlZAGZj0N22OL8lsf3NeUaBzb3n+rEybEjf54/HNRSiCQ4qf1PCKPEoMM2tma5ZYUY7xVPpLU68SRz1pI8MF+PK0+jPUST2pCV90n9dG56+OlldAWCN6L3Ov6e1eQvTIV15+eVQjURm9PD/own81Og33plo4G0fRKblnGlkL9VQudnINmjs3M7zDhTMaQFlTFNBuEbTVQ1qa1gJcPQHFatvDQn8Sf6SZ0BQRGlAZP9BDto3OzZKytlYByt35D+JqXvUKYaZYpRcvzZiwokTRrYYoiXXncbEuTsYElZZkvw7lDrcnIeQIkFb1r/phd12/l13QtnRPl8PcyWFx+3AVAKJp4KtZ74pENyTQ93GxtEtBFNfriwV5QPnzW1r3GbPjGAbYRTSmHZqQ0uw49Rtyg+0S5dSiQGXyJHInmj4tyilU546HnDfhGth2ilvej2t7HHSwDKLfwf/mmHgvsP4CzYD5mZ01WlKFRz3oqBqdIWs0Sy6s3FFHv3s9v86xMBcoWcMddrTViSVhneiDAqkmP3bjced8EF38nIGbBaxvuX0qfnkkwmV2wySbISHclF3HmM4xQ6H/9/r8HmRjttMgLnOsESJr81dkPdPZBd/AKv6OMTsxNUcZy5BHCMT0mM6rfFSTlQ7dobY3hyIm2DDb8EMwmAM4AWYcFYMJmziHd6neuoUG2sdSOr+oDfsE/J0Y8mQAjrvFyOrgSRL3eCUwKoDyea74e/pg6Y8Kb0+dPqGcSslVpyfAYvbXOb6pncxexpe0h2sEi5vTlw9Q4xwRlHipJ6/W2WDssN3280I85xCb96GoCi0ByC6QkaDdGn9TcRM64UPlr2LxocCB4wz17RjNS54QVbaZeegYol30mDNF8nIet+tX9ispEXojPWm+3XP8gYAk0Y5+trP196H0SEFf30ITY5g16hbqhPcaXfAS+4+lkcHa4ZOSxG56um5dwZfK0bsMwgSQarhKFSmGjWxKOEpXGg6zo4StqW1TK+iKlvErvIWzU/9Z5L2XU6y+HQZK2b27jhoJcj0r+rb/8DuXgZoK4yZKubj1e2b9AYoHe15/Bxxs2+lCEKyTqyXVygVAlcaJsi28qxRNHKAQql1DS6bpWvxfsAoaNG9XY6f0x7zhFR3DegOwqh9bv3Lhp5uJwg3kawq+1kprYk5jXVhQCcZfq30dKKOeSOXrj2tJdQqvxCAVDg7xP7RJWcsZReO+/pTwtebH5FRbuVja++BPpECN4csi2xu/yJn9TFc7uwsaPbigukWuh/jrLCHUwfjOuaOC7yBDYdI4iAGvS/0KoSauxpSz3zZqj5bkRNaLRsOoSnS0N7T+ISIDfJ04mzCwpoDNbFoKBHzlKgkujmZNj21OZbrMfwHRWcD7WWMjslTY1qJbLhA== 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: SdryDSCSPsUFxxqVUnjjh1Ebm6hv6VsS+tzLpCtTErosbDciFe7wnDE26Nj18g9ZD8qwm0T9iXknmDegKt0EKI37i3hfWOQUokt8KnRo4QYzDmWP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3dzMWNpMpWnyY9Kr2iOUwT6WbCWy6UjZF9Cz6+dhS4db2FkGXvlFToXFqYfkU3ODRBeoCcbF6351+hM5aRVIOcC6a0dpNsIEaujwnmNLQSjtxdvOkMrDzxkF2aPm9hmH6yqauC74sGgvZ0MS1Nvqn2KszawWMHnfneCXbsFHT1p9cVdz5kP5ZGjX0AQQO5Db7Et7uaZfegfMV40w0AAnWQQ3sC+6e0F6jYSjbOuaNb7bYQv/LmspCO5kYc2ZvMFnlBLaZsvOXPy8P/vV3iJFkqaKOhYkKoA/TWPzLWp0BzU1Fou5/F2uXNub/DLPOBirAKcdxTLO0cbOt15uQhZcS0pIe8rvfGY65LBan7SuqMAvfxWbXXO2FDC5lC65JxtxAAFCKV2D6PR0z0G7pSN0DRBF550TSQ+L+Pqq X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89db2e9a-0e1c-4e31-5031-08dcc7fb5adc X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 07:22:35.6494 (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: dXDbAtouoJe4mvaudet3LZx1jekxCEiT/cQ2QbDH58eN18/fBI/Ivt9wgN7H6EiG3Lj+7A0syb3I8WG2F5QxPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB5172 Use devm_clk_get_enabled() instead of clk functions in rtc-imxdi. Signed-off-by: Liao Yuanhong --- drivers/rtc/rtc-imxdi.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c index 284011c419db..6cd75c5d8a9a 100644 --- a/drivers/rtc/rtc-imxdi.c +++ b/drivers/rtc/rtc-imxdi.c @@ -778,12 +778,9 @@ static int __init dryice_rtc_probe(struct platform_device *pdev) if (IS_ERR(imxdi->rtc)) return PTR_ERR(imxdi->rtc); - imxdi->clk = devm_clk_get(&pdev->dev, NULL); + imxdi->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(imxdi->clk)) return PTR_ERR(imxdi->clk); - rc = clk_prepare_enable(imxdi->clk); - if (rc) - return rc; /* * Initialize dryice hardware @@ -794,13 +791,13 @@ static int __init dryice_rtc_probe(struct platform_device *pdev) rc = di_handle_state(imxdi); if (rc != 0) - goto err; + return rc; rc = devm_request_irq(&pdev->dev, norm_irq, dryice_irq, IRQF_SHARED, pdev->name, imxdi); if (rc) { dev_warn(&pdev->dev, "interrupt not available.\n"); - goto err; + return rc; } rc = devm_request_irq(&pdev->dev, sec_irq, dryice_irq, @@ -820,14 +817,9 @@ static int __init dryice_rtc_probe(struct platform_device *pdev) rc = devm_rtc_register_device(imxdi->rtc); if (rc) - goto err; + return rc; return 0; - -err: - clk_disable_unprepare(imxdi->clk); - - return rc; } static void __exit dryice_rtc_remove(struct platform_device *pdev) @@ -838,8 +830,6 @@ static void __exit dryice_rtc_remove(struct platform_device *pdev) /* mask all interrupts */ writel(0, imxdi->ioaddr + DIER); - - clk_disable_unprepare(imxdi->clk); } static const struct of_device_id dryice_dt_ids[] = { From patchwork Thu Aug 29 07:22:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978272 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.a=rsa-sha256 header.s=selector2 header.b=QRBzyXAO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=linux-rtc+bounces-1761-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvXnP3Jbmz1yfn for ; Thu, 29 Aug 2024 17:23:21 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C4494284512 for ; Thu, 29 Aug 2024 07:23:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4689D189502; Thu, 29 Aug 2024 07:22:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="QRBzyXAO" X-Original-To: linux-rtc@vger.kernel.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2062.outbound.protection.outlook.com [40.107.117.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55519188CBB; Thu, 29 Aug 2024 07:22:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916165; cv=fail; b=EZRvVmLrFHurBoO5hWfNsOiHi/3CNhkgO2gVCtYiqdyPz936TX0DMeiIRSgaVgSRttQyIokokT9sLiYdqTGk7fvyWLk2l5R39PDqku7tIkhvTuc9ku32kvOYSc9QgDhFookbFzx9VEoQyAIuUvGc07dwDf/l1PxTrpcXazEu68A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916165; c=relaxed/simple; bh=cT6lZHUXAL3M5l4p5lfRnf3CleaDt4fo8YrTbkKBtlE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=L6uGzlvRFyyt7SeAkZPhDx684AYWJZAf23M7tQd7gaiCYc6zcYnRjQt2JYCNYKYG+L+cYa9ZHm3/vbEbX4xNHn4PXLp/wOi/aD0hCXIzAdVpjhIoV0LH+kzoQKlXIfXk7T5lbgkkrCK0yAAQQ9tr1/0ahpwqIcWEA7LpDuLxmYI= 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=QRBzyXAO; arc=fail smtp.client-ip=40.107.117.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WtV7SGl9YxTgz528qO5ZSdOdByj10UET1+zV3XNch9BPNvzfMRF8+Hl8gAxBVNrINwh/yD/Mz9KK3IwmwEDL/WCu1lAUGH/x3QNwvCEtvAfv3B0MjRacbZI4jltuoE4scjoUWOW9pLZUG6dmMhILmjItdoMdR/Q5qiKIv4c2ljFypwOCgteVCRVXM6opSkd9WyRU4xRtrDShFIF+VmHipPki7+4B6swUCnCYyqcWsIRTKiU68KHO2EMkEOoNb+yuH3nFMYHV1SobzGGloWh9WwK35lNfUoGSRklB3canGqpUKE5JuBvVs8pkvt/gIssnP8j4F7IaM35NAG6dqh+rOw== 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=NymQfXAdRyVLPjxH+hsLKmNSFb8NpN7HWNp1EKUg3XQ=; b=PSHiPcHc3fMZh8giH1ezdOQed17au/y1BUXI0WLLB+f+5lKbCSQu6v9CRlSS2uIZwjYL0TA/2wSrVRqUuOGpM2d7ewOP5+KYrKm1Ro4ueD49+98yp5nLwO8ckdtJ5AATr217UHYJXAyxV5KD++WSi88+ZO4EktxWvBebBj6FWIIsfcjzwJsjJzNaqv1wAf64vW4+39bNpn8p0uFIEM/8bchyeBV2lIX6kbc2i+rUe4PC/DKr+ErVkW0P00y7VW202mcZTwBaAj/usoM5XcVgsR+39WmVHOTxCLKh8obJqxLWPocl2WmIvEYsbp555bKwadGlsAYP0P0X2OIehQKnyQ== 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=NymQfXAdRyVLPjxH+hsLKmNSFb8NpN7HWNp1EKUg3XQ=; b=QRBzyXAOJGFKIvgMa9eYyhC9bkqlE1pYIozaVLmzHFWZOx2EireePVwUCccfEF0bGu6JwaBchzQsax5YYAi5YMDr3ddvDv4+e+YKUhOfYjbj0JQU0KdI685mMOWCT9XqJtBPH9dodn8BqGO8UZqOtkV26DTmm3QF2vlLcr6KG30TZ3UuMmYSpxz5tfvgwFAPXzWYe0HeIh6Wu0xRkrbs8wpG5qFfL9swMTz23rAMMaDBsZtoSstiTNZ1d3IRQk75C92raVaT5plYlDZBFz7dU70dQxizYVABlpfMlIRwDPUwn11sRnLp6G2xSepAqG7Olme6ntLCn49AZ5oPVD6oAw== 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 KL1PR06MB6789.apcprd06.prod.outlook.com (2603:1096:820:ff::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 07:22: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.7897.027; Thu, 29 Aug 2024 07:22:37 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v2 3/7] rtc:rtc-mt7622:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 15:22:05 +0800 Message-Id: <20240829072209.7253-4-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829072209.7253-1-liaoyuanhong@vivo.com> References: <20240829072209.7253-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYCPR01CA0010.jpnprd01.prod.outlook.com (2603:1096:405::22) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: linux-rtc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|KL1PR06MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: 048c82fb-ce00-4109-6725-08dcc7fb5bdc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: NL+B7d0o62OsO3G41r3RUcBE8Tl383+ow48AsAOpbKUayAxX1/eu4f844Zggo+BvEDpiX1A+SGKwHJfF8BvBVR7s/fmSHmb0OdejE2rdziaeyv1BlXc2glp8TGHnvg/SzVsAtEGWkjUAfOIFXHsgHnfLxIMWfVrLfjMt5iyLu5/is6XfrNAPQBX8E5sJXmlqa3kTjTypiXnvB97FmYQ0wKM5ShBcyjHfVC4ZZPo6WJfPPDxw+B87fafuG6KkMsF5i18lknFstrJsut5hYdP0b+6p7PW2r/j77p8LK7J1XKIHjqLNGVkLNlUADueBSMDJIACW+qbt85JfUygb66PXEzuthInn+g7lfSr3OmKiXWP0J1P8HwO7C9sihYBR6Eo0l6KisoV5E0WiriWmzuDXmclCYxQlrEa+wrbZhySj/cUa8+GqYtfOGr6lHttfAWVS5T0ZyzhA+qCa2xK0jVEWPi6HfdJayu4FhmslIQzAAhZF60/naBYKhwg2fVrOnCRiFcEMbj6iqrDsHnCFSN0KAsLZziS0WDO3klqmf6UfDF1GtOBcgB8EAOad+3AfBK+E3CZar5eQpfFw2H+cfxFU/WGcdExmkZLua/1xD1kesubHq1a9kPfWylhtwflndkJV2taeEYkz1/oCuntho2msdGUxI/kY4V8k1see+UfsTJNXdJPYzV9wj01oElSewtF4GBFyxVxzPX+8wav+MfuQUh1V8q3N3emEt5a6MWknbvPaj0X5qUEMAAwnPgC4v+9WMsL5P1FEFNWqycGTxrVebVawDFxZ27rH72hPbO37bhnxXjDLYBgj+0zK6xIVDDWg1bmVAoebxklrpgtDylXsm9jRWMRoTSu/uTQ6vMDczO9RDgHTfolKPlt/ykiyZPI34BuTaizMYQncKED7sql/bXOwIN964EMUHWP1OqSpGhVgz9tMG8SIH0+4SANCY5ZJXcdXLghrgGtX6wS3XJIoyLsGf8UkuBEOAqmfgYGLQSohWGqiET8BXuSP+oHpwL9VU5NMTl/2Ax5Rn2Oy/UrSgMuFM/eFExh1PkWq8aabsgisMrNDvm0yFNXrTz9dsO8wdKdq6rwvATNWl9Ez87LnAe++ne4lsJeGkbnU04KHYjFqbBD1ZsqNqzAJX3vu6G4cB+TZkTMnsUK9glW8JnMxNWFhK5pXCM1NfolwKm/8J/I/WyA49RzquH5okUL6pVyYfRtPuwB/rd8Ck/w5NJgJP66+BVFT5ysBQoTdWgx0JMjvb5rcbvE82JDsnhUtRM6YfsPyYyqW7RdXnfCK8BpxLodOaKrvd/HeHtUO/SN4MOf3NTVZkR5HkJ577CeVV7ppf/NLaaC0hwwkrfI9oolwlTm7O/9h9TzzGaDp8Qc4DVDRy4pRN9a5BsOx3Fnv5ZmXfbP2IOpaa/eZ7KRgqC8g7Q== 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)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Wik6eFObzULyt9TfmhP9j5r+RoovUTey8GjP1Rz8hloo276Ef8ERy7n4xbSoUJHgV49M0OkYNFOV7U2j3REOVKYOBXnUl+7KFFrNdeOuGWfJbmwB/ekW0nz8bKcXNHfv3rcGwS6bAf6CdevY9emeOnf1hjjDsD8YdWeBpRuViK8j+F5XCiA8dh5+gH8i8Iawue8E8c7niaDXHY/vYuDpgmSHS+gUdXtva9Qd4ghwzLM5rGJoWNB46b+PKOBF11XID6j1Xbep5y0OGYIBqaWQg6Hphbbx8hSrJoeI82FgDeVKpuy0/hONtOc+mh0yuPmE4p1b1ztHKYp6Au5IXQEnO20mrzGF+Ixs8iZITD0Ja8cTXeHbXGZB0GU3tafBEt7WHstEP2PLkY7s3ytaGEZdUoeF5LOMppv15u91G3QjwEtkRQBCgiO+vLGL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GnhlS9yRZr2rb7WZ2yBr89AkAK8+wIALcrKXKJueA2ksTgAzBe91VPGsA6Ose69eqjeHbLDRfQRiKFyzZ9 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 048c82fb-ce00-4109-6725-08dcc7fb5bdc X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 07:22:37.3357 (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: uG6fxTAvFR6dV73zlrFjWmUSA53G0ZuOngIybyFBjqFihXYsj3h34RaxtbpPNzgGU3PtUnnTq3NZ257iqPu/yA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6789 Use devm_clk_get_enabled() instead of clk functions in rtc-mt7622. Signed-off-by: Liao Yuanhong --- v2:remove the clk field in struct mtk_rtc. --- drivers/rtc/rtc-mt7622.c | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/drivers/rtc/rtc-mt7622.c b/drivers/rtc/rtc-mt7622.c index 094c649fc137..0a54e9844840 100644 --- a/drivers/rtc/rtc-mt7622.c +++ b/drivers/rtc/rtc-mt7622.c @@ -102,7 +102,6 @@ struct mtk_rtc { struct rtc_device *rtc; void __iomem *base; int irq; - struct clk *clk; }; static void mtk_w32(struct mtk_rtc *rtc, u32 reg, u32 val) @@ -304,6 +303,7 @@ static int mtk_rtc_probe(struct platform_device *pdev) { struct mtk_rtc *hw; int ret; + struct clk *clk; hw = devm_kzalloc(&pdev->dev, sizeof(*hw), GFP_KERNEL); if (!hw) @@ -315,27 +315,23 @@ static int mtk_rtc_probe(struct platform_device *pdev) if (IS_ERR(hw->base)) return PTR_ERR(hw->base); - hw->clk = devm_clk_get(&pdev->dev, "rtc"); - if (IS_ERR(hw->clk)) { + clk = devm_clk_get_enabled(&pdev->dev, "rtc"); + if (IS_ERR(clk)) { dev_err(&pdev->dev, "No clock\n"); - return PTR_ERR(hw->clk); + return PTR_ERR(clk); } - ret = clk_prepare_enable(hw->clk); - if (ret) - return ret; - hw->irq = platform_get_irq(pdev, 0); if (hw->irq < 0) { ret = hw->irq; - goto err; + return ret; } ret = devm_request_irq(&pdev->dev, hw->irq, mtk_rtc_alarmirq, 0, dev_name(&pdev->dev), hw); if (ret) { dev_err(&pdev->dev, "Can't request IRQ\n"); - goto err; + return ret; } mtk_rtc_hw_init(hw); @@ -347,21 +343,10 @@ static int mtk_rtc_probe(struct platform_device *pdev) if (IS_ERR(hw->rtc)) { ret = PTR_ERR(hw->rtc); dev_err(&pdev->dev, "Unable to register device\n"); - goto err; + return ret; } return 0; -err: - clk_disable_unprepare(hw->clk); - - return ret; -} - -static void mtk_rtc_remove(struct platform_device *pdev) -{ - struct mtk_rtc *hw = platform_get_drvdata(pdev); - - clk_disable_unprepare(hw->clk); } #ifdef CONFIG_PM_SLEEP @@ -394,7 +379,6 @@ static SIMPLE_DEV_PM_OPS(mtk_rtc_pm_ops, mtk_rtc_suspend, mtk_rtc_resume); static struct platform_driver mtk_rtc_driver = { .probe = mtk_rtc_probe, - .remove_new = mtk_rtc_remove, .driver = { .name = MTK_RTC_DEV, .of_match_table = mtk_rtc_match, From patchwork Thu Aug 29 07:22:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978273 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.a=rsa-sha256 header.s=selector2 header.b=cPUiDnew; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:40f1:3f00::1; helo=sy.mirrors.kernel.org; envelope-from=linux-rtc+bounces-1762-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [IPv6:2604:1380:40f1:3f00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvXnf62Mhz1yfn for ; Thu, 29 Aug 2024 17:23:34 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 67511B24629 for ; Thu, 29 Aug 2024 07:23:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31A1518991B; Thu, 29 Aug 2024 07:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="cPUiDnew" X-Original-To: linux-rtc@vger.kernel.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2062.outbound.protection.outlook.com [40.107.117.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74B22189519; Thu, 29 Aug 2024 07:22:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916167; cv=fail; b=JXC6k4oblOMCq3roTVfVheEW7ofiZz3nY/cb6e1aZ5wvvcBkf0VcXFegzE15mWeyLa+Ahd0pLOfmtmz4A1oeZvSXa3wAlYL7Lr4WcfphabcLkL1JKusRCSaEiB5C9nZkzCJed/bYFg7Fkqy4rINhWhjmE1MEjR7ElFU5vbedEAM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916167; c=relaxed/simple; bh=pBOUDwfAj957ocT1D5WwhW/HJIWvfdLKJC+CdSjpf0g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=GPUrScEFwnFct0QYsAoNPFqXFsEGsxGiedI6g+fzQd4zLchdeCPGGui7CbcunEUDePPhm7c8unrLDtHd6ln1Ub8w7gdgjWWmud6Fa9/o5LtutsFz1ulYyTy3dpM30uOFkrKeBVbyLvUtGNsc7Rz0XwEfjMErtvNQDfvI4n6NqlE= 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=cPUiDnew; arc=fail smtp.client-ip=40.107.117.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ih3WhAShsn9x5w7s9PMCLk94Pqbyp7W+knqOTGvAVI5ropvPqtR9FG9wrvZUGZ+Nwxbcp+3HFKtHy8hvoZ70SECB7+j2nUrKmHSPTZt3U/Jq50pLC7qLU5FxO4yh5oAPaArctFnIahWmUERqx6JLZqCjrYNE9O3+hycSSKblL4BnD8a5tk1rP8QBIIchyYdF37a5sNT0ojJdf5ctsyzP5uP5VtgGItEuaXGM+FZcoJ0pK39EOJ7ObXE5clghFPYpgjgUr3ayg3KiZgjy99Ys17kwX9HXsldfBLvF91nZKVWcnCto/ZFfQObScPSm/0l1hWDkQKla0fxssvBO6uF3vg== 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=pwfsmnUNMTALBVZuXoh7YtP3zSRvNNe2aT7Tli4xyMQ=; b=DvB8JTQfFf64B94vAIk+rJPRXc9BBPxmfX3jDpAs16SbowsSxZqpCmhlOrp5fMi2xKI3vwFKLfZfXAatJPhsQ/hxzQWcohjpSRyWE/xTNZ/H092mKG7gdpW80O6YxfmzWCveN/gRx9zAQiyPBMSW5MCM3Y+qSC2nQoi9YJo0hXK3VdZogfa0qE6TaBQjhyyMuNUL8DLN56m97aUZkxSB90h1brv+CiOpkwktvxJgBXY/X4lsRCxiGq707srBRTs2PuSTqDF1sDaOhqgfjaz9KJjJCmMHZhJy2fIQ0CGk9hLVZL5q2QVW9DqB+seyM4LLqMivuYCI1miVUv1el9wNaA== 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=pwfsmnUNMTALBVZuXoh7YtP3zSRvNNe2aT7Tli4xyMQ=; b=cPUiDnewNKL/Fp7S4qYmyIuJ8zvT6PwYCKcLue5IFsyVyiILLsV8KjxyAs0WBMBWNmVjXysvI69zGKq24zoLwHl9FvUJsABvD/+Hz3ZjRkQw6rqphms0qlsUwNHOuNq+Kuzejpl2fAv8L02YQq1krhQiEddeVCV71qNJYw8YRHYZfCFrpIs0azEuDfCbcgVv/EzsjSokUZJ9OwX9jb8ft8ZZU0O2N3njO8JVOEd+0NHOldr8iRvO6NYuC7WzMMtt0+HQ/LtDw2tDtsjPiNgazYbTcNSoqodm1zdHMo9xvLIFCHsH3ws2mNQMhD/0mJAsT+8Gzl+jOqhXEkzu6TQmLw== 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 KL1PR06MB6789.apcprd06.prod.outlook.com (2603:1096:820:ff::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 07:22: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.7897.027; Thu, 29 Aug 2024 07:22:39 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v2 4/7] rtc:rtc-s3c:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 15:22:06 +0800 Message-Id: <20240829072209.7253-5-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829072209.7253-1-liaoyuanhong@vivo.com> References: <20240829072209.7253-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYCPR01CA0010.jpnprd01.prod.outlook.com (2603:1096:405::22) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: linux-rtc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|KL1PR06MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c6dcb43-3043-4ae0-d847-08dcc7fb5ccf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: y9P2iwN2u9GqM57xZF9GN79GLQvmWcwjwc0EdltoNXgj4LEI3ynfakjiaAI2owOljuCJA8v7B+QKu+BQ/yPLDRVWXogxMb9bQyahQ9Tj4U+n8YWpWF0nOS6Z3f+1EPHb5LiPWLIdwEPyedK98Vstuvg91xeBSuSdWmmhvL5f2GLtUFGd2XhSQ6Z6PnjXx/8CUAIIQvdhA0VNIuCGVeztHEjZAaoF7iddsuUWZJwnUW9WuOhPSUm2lq2TuQX6B3Po0yp3dzXholdVcom8ybM0yk0o9CHfTcfAQnzCGJwoEVi6RMrtUGB4/s9asGNQAaPIfaKFn/hXNCsT85wHszs3vRGdvV/BALoddjMqi6S0gJNXqGseWuPDYbjBlgNa0d0MaegDAUrmgPn1ygnVGVmA8I1H4o8v6n5delWkT1AJ5LUj3NJAhop2fncX4lDEqSceP1OQhs48UgyI11zBT0ZABerrFwpT8vi0zNOoR3ADiI1jVK5rH3uDyTvuPTagPG14KoMr091WV+BQVDJmAoah+iN+oIvTrGS02RXMUqfDpnjmrmb8XwYzKHSM6yuDvhGH5lKIu2gLDZhrj3+hj/UIqRmrsIJhMsRmgqIvCnR/AXaKByZBvh3DoK5RHN9S/7MZMtuZjaSikC7pfMJMAxWQCPtyndxfp3t6flb6nyyaz50PGpR4guFNypj6Rztz5fEKAhGacrmnnpN/nAE/V+5FPaHK1x7h/T1+iunB4EoparwuS+hzxb3HoBBL7ATb1q7m6AHy3ovRlBZU6ZUFXr2qiDCJRBT8+iOevyeWsx3S7LlZNkq76zd17H4iTzIKfIpV040POFSO07L0QZXWxe3hryiK0zaQ2gIWZy940oQUdc//dYKbR2JQCOpYoigOt1xsVnpIf0FDjE8WFHcrKtH8Fs7kQKwHzgbAtF23sx94oJZqlvuUq4Agvq6zq6aaSZQ3h+y+X88RmyI/Uk+xg5VzAhnPX3MmAZi0u7PhsbaDqj9/Gb1I4Dw2hZ7W2pznUr8jMrAkpMZe0nwZb2naI0ADILRS8qewpqaui9oDlxbSNNahNQ89XkAu6mkKvBtdonj/oPJEJ999d3o8iiyAKGUR189+xL7t++7OgQMSpz0WKpw18O2lKYfYk2oEC29X027iVQ7jGU8FtuaSwPM7laae9Q2nucbbxGk4wItr0/YsfJ8JtKThclmJJZ9yrcluAHCEEXGj5jhIVJ2TXt2iFAdiW6VLi3tmLUfjf/NK6ucRmsE/GV79uUiRsS4cHavu8BlkkkLyDmHhUlHatF9MC/tscW9fF9N0jbodlo5fLejOXBKvC6i4n6Q3p+ZU5G+xtU42XzQbMM3BPxyYb2FLNOD0HsPQzK6PUvjWOoKsfE9LRH3rlkXol+EQki5tALqh78GlHcnABRCg3kAL1mhdFdn2Yg== 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)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BGX6m3DAgDNbYzlVYtjkYw++Le0IfBnfvH5JNj9gGWi2sYKCwaNdDZo0BXRgizp0/MLtVQrTC+WPTJnSTs7YNxQoj4AVjicYYj1xiH7kY8FfrWosVikfcZnmcBOZuAX51fw5NBe6Uio27RGN+aFnEBJ81Y8kiV6ynZLNOYh1f1lZIkJMiYmeHeUzaPz4pvLH2VS+z4KRJJvgUocjKuC/GjeVvh2P95ri39iF2opsxx0Yfv2e16OhkKzKfpAI6mRm67DBQpAc6iWi1iI42E6XCnUiX+fqP0otUVYC8sanAqH/aaIHcJPQFmDArpHM4wJWPOZS48po+WPR89lfhHuAd/XoqEJl/6uLyYh3T1phDKEdgq1XKB2AI2rHBEGXgy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dd9jsjxsYml6746murV3I4bOuoamp15ZHVFVQbhbw0qSDyWj8RDB9vtB3g8NFPynCkHjCBi0Us2MepGl7Ce+2reLNoOoTPanb8ZbM2uXfjZxWjEYiMG00WNMjfGOQqf44Mt X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c6dcb43-3043-4ae0-d847-08dcc7fb5ccf X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 07:22:38.9979 (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: 0JV9SEY7aQ+LBXePqkVyP/amkvMGXZ25Lx9LGrCguwd+YfOYWjRPrdYQJUp3aKvOU4ilYCjJUXL9qGT4FQ6+8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6789 Use devm_clk_get_enabled() instead of clk functions in rtc-s3c. Signed-off-by: Liao Yuanhong --- drivers/rtc/rtc-s3c.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 282238818f63..ecceffee7118 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -425,24 +425,18 @@ static int s3c_rtc_probe(struct platform_device *pdev) if (IS_ERR(info->base)) return PTR_ERR(info->base); - info->rtc_clk = devm_clk_get(&pdev->dev, "rtc"); + info->rtc_clk = devm_clk_get_enabled(&pdev->dev, "rtc"); if (IS_ERR(info->rtc_clk)) return dev_err_probe(&pdev->dev, PTR_ERR(info->rtc_clk), "failed to find rtc clock\n"); - ret = clk_prepare_enable(info->rtc_clk); - if (ret) - return ret; if (info->data->needs_src_clk) { - info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src"); + info->rtc_src_clk = devm_clk_get_enabled(&pdev->dev, "rtc_src"); if (IS_ERR(info->rtc_src_clk)) { ret = dev_err_probe(&pdev->dev, PTR_ERR(info->rtc_src_clk), "failed to find rtc source clock\n"); - goto err_src_clk; + return ret; } - ret = clk_prepare_enable(info->rtc_src_clk); - if (ret) - goto err_src_clk; } /* disable RTC enable bits potentially set by the bootloader */ @@ -487,11 +481,6 @@ static int s3c_rtc_probe(struct platform_device *pdev) if (info->data->disable) info->data->disable(info); - if (info->data->needs_src_clk) - clk_disable_unprepare(info->rtc_src_clk); -err_src_clk: - clk_disable_unprepare(info->rtc_clk); - return ret; } From patchwork Thu Aug 29 07:22:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.a=rsa-sha256 header.s=selector2 header.b=a+yzEVuZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45d1:ec00::1; helo=ny.mirrors.kernel.org; envelope-from=linux-rtc+bounces-1763-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [IPv6:2604:1380:45d1:ec00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvXns6TWDz1yfn for ; Thu, 29 Aug 2024 17:23:45 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0DEF71C21F2C for ; Thu, 29 Aug 2024 07:23:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14D9C189BA7; Thu, 29 Aug 2024 07:22:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="a+yzEVuZ" X-Original-To: linux-rtc@vger.kernel.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2062.outbound.protection.outlook.com [40.107.117.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65FE9189B84; Thu, 29 Aug 2024 07:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916169; cv=fail; b=TaCrhYanq/b8uOmEvZjg1kci8sFL8HqyRpFfGAYZSa0GC/2uaIyupRV5GHF3zUaYRFIgKe60zWPNFK+YYJl0N20io8jP40CZrcu8ykguppkQShAj7erA3HwDf8Kmr8NwMCT8YWM66jVCFdPUmS1B2a6iHHrO21zBJKOWxr0I7AE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916169; c=relaxed/simple; bh=ANEWUoefTVKXXL8n7BXUbO9XU85GgPMIbI4eoiMkzE4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=E6wuR1OJO0R1ZwEabdakMlyaS1pdYnxtOKw4ig93lEw1M6X1QhRFBPQWiWi+zyQr6Agi8eCZeQs2T7UjpPRXV+3QkJumBcjpD5DMsoLkOAb+q4ozgke6byKrwBXrS4xlskdHuI6Z5SGg+01syuxttlyDQgWAKVfe35BQ46CVxZA= 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=a+yzEVuZ; arc=fail smtp.client-ip=40.107.117.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FsYPoC943OVFQqJ+AbIGZjy+h4lD60t0gdIX3Vn9xsEJoh5Y3rBjcDz6CmVB55XGMIe1/B6eApkm2+Do8HXQKcXtL5YSY1RA8tdZxIy5aCgMY9dH4xzbwMyiS51o9aBm7WpG6OnRGN9zevQvlXehzoMf5skzHYiCk0+XnxM2PHme3RW/AQj8zmToMFeU3O9pdTuZNW+6mZpV0skqQIk24wBhMsqX9yIM5W2gMgUsgC+FXWFVY5YhiXjBsRzJABtX8PAmHHusBN6jsifFdNxF2x2pasHRhayaMuCC7+EG02Q4hU3rVXaiheL6GRAnrJkSCv4uJeT12bI3X6PpvNLLTg== 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=QQFSBWFCx04/Lm5ZIwYCUFvejgRMGjYjikfOi5Et4bk=; b=OGTeAINiYqP1G52UtaUxJbhlORxnr6DqGGFBLMAPYsowDBTMb+BhXELtKaG5tTFTZELWTGi2Bet3mVsKU/OBBASn6WYNHerqMO1K+38sRHURaaCBp6CEQg/QMbUSdRi1vXh/m4QDNdXk8bGhh74ptmxTlFr9CmEfdfE3Ir9Zvw27M+kV82b+XwIREpc7WpgArbS+i+Um9TFU3IsmtMz4pUguAc+RVIAM1kphsSEUpVihVNhvDeWic3eqX0GrC3O6lExhcRz5fLj30JD1utfxd8J3/HtureIWpJOsOS+MUvnzYfyiwGSYOxCmDMAYQpTKPnbEypmsO8jEnYIZ17s/TQ== 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=QQFSBWFCx04/Lm5ZIwYCUFvejgRMGjYjikfOi5Et4bk=; b=a+yzEVuZBGLbnkDTzilAd4vsuk7Ayzz1SXl0GcVWE0WtBGVlDvueYw0+dT26mzPqtHwNtgz0deGK1OzTBhbxwuFA0J5ljUCDsS/Fdr7U8Zjz8QIcTXNHLMCE2P5CWeLwHC7ENIWDkcvGZBzIrtQ6XxSZpZlpewC8KG9FzAo1xdhh+5VKfU0xC1JQcokop6NtUF7EnztklPeZz4/NHPxDTAz0s7XJL0Gt2zJrRvdM1kre55x+40aavNUGFa8hhcTVYVXKOUXkOFJ3NJmFPCxBoKeQeKhNoQkoNqbDWivkyaNk0TrjWvbYIC0bML3OLT16/XKg1Fk6AkacNB3tl/kxfA== 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 KL1PR06MB6789.apcprd06.prod.outlook.com (2603:1096:820:ff::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 07:22:40 +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.7897.027; Thu, 29 Aug 2024 07:22:40 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v2 5/7] rtc:rtc-sa1100:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 15:22:07 +0800 Message-Id: <20240829072209.7253-6-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829072209.7253-1-liaoyuanhong@vivo.com> References: <20240829072209.7253-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYCPR01CA0010.jpnprd01.prod.outlook.com (2603:1096:405::22) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: linux-rtc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|KL1PR06MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: 4986b9fe-188a-48f6-b63d-08dcc7fb5dd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 50vJRl+1I+hKFmdylKB5VHQnUUO9WwCPk5jjsmeJ5vkKx9biZpsGHooiwW1u3gy7Z5xzFcvLNHksIgUiHaELTG/VpMLIDQGhSOIuKxWY/9EVQsRaPqlKxF/UYZJiW8T5xlWOgMk9S/JvKmSb4b+rrL99cxdY+8N9cTLoSaF0K4mmT3XDrUDteJ6VLQe3ynR+wLV1wBUGXgVh4HJhV43Wba6WQcogZ1gVRgN16v7jg+j8yJ8OsDdj52qrfNshGMiyLJkhQpputOY3CnfBn//F/p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E8Hp9LpEC0sw+77+Tp34TChHELwJPthescxuUlAYzhwa3Pvuz1Co8aQFDjmVZ6hlnfP6pHG7IebDg== 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)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qdo9sHmkOZx7WiuxpM5XnfcMvbaoQNKeH9aFleoMVF714G5A5y4INC+qJtHBWYhzlyRFtszLh2sUgi0AsSifRPYuwNd834f75GUSTnSlOiqU0XUNmmXp1VjOwsyZ/PTIZ/c62JjVHcxfx2LMc9t0UpbFTGA8qV+YL2q6afY0he8hQjCNFpEEwrbkxQldphA+tqaYjQviUqMUiIwn2GSDJ85yzqd7HBNwUFf8z8IktbMweCp7eK3KbTdvjEg2InbJUSdH9vbjbTH5AGJLxv15qva6E/kwPzrFrhYpiUKgizTNb0/nVOPWt/ho7Bhh1Oivd+0y99gZ2H0ntpcb730JdKmuguB/OlDInwyq6Fk6a/ef8rB3Z3LfB7bfG2HpPTVHqnJ29gO6IiPtAE4EC34sPQZ4Bspc8/cz1eDiG4AsO87eDEwpfRQZiYLb3Ma677iC5EqYt3k7EZwkSDAsDQnUzoWbXqYrvU1NAmWNZzmhuTpYDhKg6CJTcfJI+CwwOM6yig0hOD8L6UvxAX87dznk2J5y30sM+WviSZo8cz4GCs4lRfr5aVMbshscDFvHevHhLs/ZnYNxVuKyACwWZDcQdn8DvyzgwzyMu5uP3JDEZcyL9+pDLesFjq0IRbh2RGM+QD63kXoeZHwJ2Hy2cu3mDKTIRaRjRc8dT2R3opay0cbSOEb10fJDP5Om7MbM0D6f3f8SiPboQ2uMyne3luEPsuwYA99HyqOjHacgU5VQoWCXb0vCVDzyZ1aulV0jl4prQkKDHkMhxJjCmkyv+4jDC/GaAE1FIaBvSEoWL5luJxZUmlRCvOLNZXjdJA0MHdMHzuaIZIol9gbCYbwlWH0mKH8mhCdl8GquX5Af/H231Y393i9czDTGP/xHR0dFMNHOC+ao7MOg3tx/PpXTnPWPBGZiY7/v0v3AQbV4U0G6XFH6Ec6RA8wcHj+O5fd0IAPpZ9lckVJ6mC6ld47twAyu04tod/jvqkkL9C/6Zts9l2kvLpb49/rT265uUPfIXefnxxAu0uR2oqnRvR24yGOdTCHLNuT7WbB5JFHfVlc2Y+QrGQYKzWwEsJTbB7Rw7+XxD4MgAfgWko24EYGsihKRit18UrsbkxV9UsbqhMWdhSgwXKoAH/GSnxPbqX/nUiCOMXlQNjCNtJmyUqfERCzchA6GOSE3W6QqgA5tt1VknTtvGK0jSlRKzGALkLmED8SLwXmG86JMvAyumpQfwq2bi0P78y6L1vemf0S/IkbrnBWFysid6zPlvcyr/8rFy5Fr9DaD/RK80+zKwgTcCYfXEvpdbbZeD8SdgZxpO1Um8+cvayIEfgW1gePXSoObNvCNxCNJjh6Q1xdt9dGFoBZkioKzwiEB4udepFkkw5g/Gm/PmlbOEmlPMg9OUdg9zrc/a5i3cfDGQ0BfQNDYeUh24gn4yV8zeE659UvOzYG4ClY7DoqYGZb0gfJ1mx4i0dUbxLty4wpVjwxAqRfFk92ZaNYCOuzScpAQe0Tjxz2r2wKhZHElcQoaHTVLhH4+Enui9Nj5koVLECdOkYoIbCs83DrEDd8nfS81Gbk6z504I91Ss7tEbLdi5Hszva6Vu59i X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4986b9fe-188a-48f6-b63d-08dcc7fb5dd5 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 07:22:40.6749 (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: bE7T0qxPzpvYMefX17BJqpCV8aB5mhDx61t3c0fh5OATr3VklHqqaIn4Xw/aA7F5y3GuP3HeKzE53jgOYKb/kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6789 Use devm_clk_get_enabled() instead of clk functions in rtc-sa1100. Signed-off-by: Liao Yuanhong --- v2:remove the clk field in struct sa1100_rtc. --- drivers/rtc/rtc-sa1100.c | 15 +++++---------- drivers/rtc/rtc-sa1100.h | 2 -- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c index 0b2cfa8ca05b..c1e9ec40de18 100644 --- a/drivers/rtc/rtc-sa1100.c +++ b/drivers/rtc/rtc-sa1100.c @@ -174,18 +174,16 @@ static const struct rtc_class_ops sa1100_rtc_ops = { int sa1100_rtc_init(struct platform_device *pdev, struct sa1100_rtc *info) { int ret; + struct clk *clk; spin_lock_init(&info->lock); - info->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(info->clk)) { + clk = devm_clk_get_enabled(&pdev->dev, NULL); + if (IS_ERR(clk)) { dev_err(&pdev->dev, "failed to find rtc clock source\n"); - return PTR_ERR(info->clk); + return PTR_ERR(clk); } - ret = clk_prepare_enable(info->clk); - if (ret) - return ret; /* * According to the manual we should be able to let RTTR be zero * and then a default diviser for a 32.768KHz clock is used. @@ -206,10 +204,8 @@ int sa1100_rtc_init(struct platform_device *pdev, struct sa1100_rtc *info) info->rtc->range_max = U32_MAX; ret = devm_rtc_register_device(info->rtc); - if (ret) { - clk_disable_unprepare(info->clk); + if (ret) return ret; - } /* Fix for a nasty initialization problem the in SA11xx RTSR register. * See also the comments in sa1100_rtc_interrupt(). @@ -305,7 +301,6 @@ static void sa1100_rtc_remove(struct platform_device *pdev) spin_lock_irq(&info->lock); writel_relaxed(0, info->rtsr); spin_unlock_irq(&info->lock); - clk_disable_unprepare(info->clk); } } diff --git a/drivers/rtc/rtc-sa1100.h b/drivers/rtc/rtc-sa1100.h index cc724f5b07bc..cb8c2959f560 100644 --- a/drivers/rtc/rtc-sa1100.h +++ b/drivers/rtc/rtc-sa1100.h @@ -4,7 +4,6 @@ #include -struct clk; struct platform_device; struct sa1100_rtc { @@ -16,7 +15,6 @@ struct sa1100_rtc { int irq_1hz; int irq_alarm; struct rtc_device *rtc; - struct clk *clk; }; int sa1100_rtc_init(struct platform_device *pdev, struct sa1100_rtc *info); From patchwork Thu Aug 29 07:22:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978275 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.a=rsa-sha256 header.s=selector2 header.b=qFRiG9nA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45d1:ec00::1; helo=ny.mirrors.kernel.org; envelope-from=linux-rtc+bounces-1764-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [IPv6:2604:1380:45d1:ec00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvXpH3b1sz1yfn for ; Thu, 29 Aug 2024 17:24:07 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A0B3A1C23FC9 for ; Thu, 29 Aug 2024 07:24:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D21C318A6A1; Thu, 29 Aug 2024 07:22:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="qFRiG9nA" X-Original-To: linux-rtc@vger.kernel.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2062.outbound.protection.outlook.com [40.107.117.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28DA0189F54; Thu, 29 Aug 2024 07:22:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916172; cv=fail; b=JpkD/Oy9v6HX5Te5FPbXwTrt6xve91O5gW8LLfx1+xWUH19RcuD3TMFDrKRegIZIT8hgNX2nktJNKyQ/7RLL75z602IJo7KFAPZVyotff06MDdAMvzKM9Io831cIMhUNlpBTvxdjGw3WpEGwx8cVlOexGudQw+MrBT8pnyIu0v4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916172; c=relaxed/simple; bh=Q3rCL/VOfCnybaX6C1aZjp5ldwRPJZgp77pk58itpN8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=dkFd1m362YXPhw8ccw1PuSsEdPpCXlqUeqxIMe9k8IRy4tQkxDkL8p/xzACqY8h3JAvRBZGufikzaQoQeXwMvctRzMmtPMx2V3vW2J+qZtN8GGp3/xdn1AOZQ7DXMhG5b8SUWu3Ghp4YYVLbK818zN00NVcIvT/YDkW7XsE7sww= 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=qFRiG9nA; arc=fail smtp.client-ip=40.107.117.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bt0Tqe2uN4pANCw1lZNIgsw3JVPSkpYiwbb8QD6DlitlYv40zrhzXv8FNDlXiBph7Z3/S82ZR15qidDZrgXXH3vRn8FuIIM8k4fFAgQQz1h1grEkuH9PbodHNN7fZgxQt1LIuIclZhY1Iu5f4wWS/bqgNcOJDJ887mI170LD+FMHRRJK0nY8emt9/q1wnhGG7ijDxqhBP+MFz/XF7TW50ztLnCpo+Sasjcds+dOhrHHOnK9sArveaKbrnYYXkOjRM2Rcw4lfREWjqamWc7pBq6KTLjzPtRqV2Tz0JGHqR+WQsgRK0GnKtgGXzXTNTrElMiaCHNIbSwYcXJjIEEqOvQ== 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=NxBG4zkDUcJFOjixKybmMVqitqT/HyTi6LrglXFB7Kc=; b=DyKFGasSa+BmjqbxTsI9zFDthMWDNIAGZOM+yjo6hzbWTlYwhXqChnY8fkATeWb4meqU6Dxpt6qQBv8XPhqotxhfvsO+Wi1RVFtYLONiC3UwTIsHfylA258l7PRY5vRCOuyUwVQQ74R3hsUtMdHg+BfNLRne81abvaskfP6c8VVTh9utOZXYZPR9kSxWjwfQH0A/B9FsyIey2DX6dAiaV6X3YyRCMM4SD+WoAKPXOICT52IeXH3jjnxqM3epC59LBfTGzvfB3+9ZKjJ2DQbij8Y+kyrzd1bdABIzhV6TozYb5n6wVuxdVuqZqSqHyOKTqrdYsRzEgKFzC0b0AWCmzg== 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=NxBG4zkDUcJFOjixKybmMVqitqT/HyTi6LrglXFB7Kc=; b=qFRiG9nAH1LEEhikDEApp9ldtmcpgWVnYZnpuDF9Qnxs/12vdrl09lw+H1CdDq9ti0mCT/eOqNw5fvOTd74jwaklz3P05nbeFdFNq7NRWX4QYHGbgD42X+7MnStYLwOHXhwtC18G1VJ3jk5ODfOTaBqrp43ooFHEDjjusEQOxnFUEALXzrg4xYRDdYv885vXgKmEzMi6RYbk6m5ekEe7wELs8+O8L21tZPCknNpqY05/7ilHCMK1e4WQyY9K9FtFhzquWqbHdKuSe2MY8K7cWFzcK+b+jtxGVWLZ21ar4BKMaxXVY/liL1TwlxyDqQ7K0zacyZIxHSD0SvWJCqhseg== 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 KL1PR06MB6789.apcprd06.prod.outlook.com (2603:1096:820:ff::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 07:22:42 +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.7897.027; Thu, 29 Aug 2024 07:22:42 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v2 6/7] rtc:rtc-tegra:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 15:22:08 +0800 Message-Id: <20240829072209.7253-7-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829072209.7253-1-liaoyuanhong@vivo.com> References: <20240829072209.7253-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYCPR01CA0010.jpnprd01.prod.outlook.com (2603:1096:405::22) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: linux-rtc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|KL1PR06MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: d6d21555-6c13-4941-743e-08dcc7fb5ed4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: U+JKx55hvv5jbjX5o4HqSdW/YwO8HCl/73wQRwR2wS0Tod1pYa/ldiDVW41B7w6TRLBAySd0iWqOex4TKDxaDfNPp2Sxe/zuvQQzdc0CfzSrw6TuEngMt5cSt0VAW9aunV7+iPyfvT18JtATuNxdEdpatkHjShaoKTLw+L2PXgIJQvaCtevS7EtGlQiqWDKwLeglnVJemLer5IQRYxPX0dWZi8L1ooo3S9AW8zyjbYbvULfjqlMruwQLda3iRas4wT7BKGAV4+vDS8GxnA3QxL58ixAPJwfgGq6TnrIliIFWD48y/bBTdej9CMQYF3nyDeLkR2wSQrifa6ZD7vxhDp5KnQEJ+v14MBFWTCK/UrDPEcscfUDok4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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)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4yjXHkBQUuLZFwilb2WsulEIowYC5ZDYSg1nFcRACAQEBlt4lriAstt9J7E9YRZmn4Jp0KDbIEVVOUZIkOS4YGzuaooTuutu0tpTSg4c7IcK51kGGnez5ldMj/ogca4cGTtvHVjMXln55FjoDsGO/EfFKiBx+MS6HtkyN+iLhr6/q2xqULC/QOdpT33eEsTSgcBDsbOszsEBMB/TrEQ8AjoxHo67A39r9uZeYoAY1mFMkpVLuwARCZp8tfaJEMKuiex1hjUXslH05M1tFM+3CR845HVcYnKelZDaPZhRNMWd4Uft72qAucH0HbVfbVY7MvLhScyn6KRG3KWU+soeA9WUweIevM9d/70A/vnUTmC7zekY2HiL/PMHUfeJPUFQ1+e3c10+hF2KazrsGfWIZz4X6M94TYGlFankHbEAd26KnxfX+4PixvC4kiKehQz9OTg3O7qCxSkEVoJlr/L3ZQw3sVvruAt4uK3vBLCrult3fvbLgW02JE1In/R6rNYlFiBUUnRhPHckXqH0+ps6YJYqIbMxqAf6RkWigrjh2faYYolgdvaNbVr/vLItxAjpaED41ktB236ZXp7eCFUJQOw5Uk0w9/YddB59lrHgCpVGoZnZx1hGVHE/Mx5//fhgxnnUpwi+glciW22BbxqnIRd+9MxthSU/8Fy217xtWcxCN8rpJIKZYcCHSjJxv9dI6dxQZbx+qsmVCtmP09F54Hky+eEKSFXXWWz7bLO+LSqAfVOX5ktqL1nMd3IHQqfI7ok72PRv+gGpu5GC4gdt8ZChuZFBtFnLplj25QCdNKuwHXgC9rxnZLZrLXgz6AuwIdd4BhMIPij0760cDCD49agspNqJMMZ4s8hmXXdg/S3tFS5gQyDuCVwv8SJeR/OvSfCRbu17NQLjrTuWUBpu9rqAiPZ+qWTK3p1f5efOXlcgJ0o3fJdTDECOs3uYcHocNxMkSuJoOmpbdi+duW1CIrGcR37858xpAE3n43aPHtaFudZMQOkXvBYzxi1hAIGIH+jRziFPgFUPszTQ6tsFI60P9M/r6KiFrJfV9l7SO2TppG2UZd14ViQuPL5tC6j4dCmh9QBGPfmRgqgZJgCiiAFFTjrPo0LV9D2NfcYZd82T5LePosthHqAHMuVO4mT/O6NCtSj160ede8ZKgBOZViOtjc7Cavv3C7FAqLbRrk5mAxDRH3nGJ00GJD07nOHPSKznZwcPGR3avoWpNCjQkHKvpzsG3T5/+V6zSm54tHo0xIqaT8XqaDGHnHQQlZqb09FJA/rpNV28neM3YkSv517v/iDeF0s6Nh4MtS55zrB7Ey1xzuNMxZt6Qd0CCRlxW6DshGFuT859651JLEPQ2tIdRNGIKcnt03LHr9H+UFH8pCmBU9pLBdQaHcRUgdG0it59RkcqbTRNfVZezx19PFSeNklBkyq4mwUb1zDE8MFo00hz+JMHQbudyUvviFsH0dfEb+cSe5/eST69clvUu77mmKbw2QDhXFoiLpcyCLbvbmD5DwdAdcH973q3QdQVvY7XN2FZP+zL6zSX49ftdrmVm00oSFvlcPQ0Yoq5BG19G0c7G1sivXNa4leHTCck X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6d21555-6c13-4941-743e-08dcc7fb5ed4 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 07:22:42.3709 (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: teZdU/71VOxf0lrxSp1ua8Tn/kS6+oMLPw1+vzpwmG8Kj3FEpUuibUPUN2gf5j172XKL92AxX5Bd6qdODjRi9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6789 Use devm_clk_get_enabled() instead of clk functions in rtc-tegra. Signed-off-by: Liao Yuanhong --- drivers/rtc/rtc-tegra.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c index 441e0a66b215..28db5b8cabdb 100644 --- a/drivers/rtc/rtc-tegra.c +++ b/drivers/rtc/rtc-tegra.c @@ -300,14 +300,10 @@ static int tegra_rtc_probe(struct platform_device *pdev) info->rtc->ops = &tegra_rtc_ops; info->rtc->range_max = U32_MAX; - info->clk = devm_clk_get(&pdev->dev, NULL); + info->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(info->clk)) return PTR_ERR(info->clk); - ret = clk_prepare_enable(info->clk); - if (ret < 0) - return ret; - /* set context info */ info->pdev = pdev; spin_lock_init(&info->lock); @@ -326,27 +322,16 @@ static int tegra_rtc_probe(struct platform_device *pdev) &pdev->dev); if (ret) { dev_err(&pdev->dev, "failed to request interrupt: %d\n", ret); - goto disable_clk; + return ret; } ret = devm_rtc_register_device(info->rtc); if (ret) - goto disable_clk; + return ret; dev_notice(&pdev->dev, "Tegra internal Real Time Clock\n"); return 0; - -disable_clk: - clk_disable_unprepare(info->clk); - return ret; -} - -static void tegra_rtc_remove(struct platform_device *pdev) -{ - struct tegra_rtc_info *info = platform_get_drvdata(pdev); - - clk_disable_unprepare(info->clk); } #ifdef CONFIG_PM_SLEEP @@ -399,7 +384,6 @@ static void tegra_rtc_shutdown(struct platform_device *pdev) static struct platform_driver tegra_rtc_driver = { .probe = tegra_rtc_probe, - .remove_new = tegra_rtc_remove, .shutdown = tegra_rtc_shutdown, .driver = { .name = "tegra_rtc", From patchwork Thu Aug 29 07:22:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978276 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.a=rsa-sha256 header.s=selector2 header.b=QJfUC1ik; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=139.178.88.99; helo=sv.mirrors.kernel.org; envelope-from=linux-rtc+bounces-1765-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvXpR6rX6z1yfn for ; Thu, 29 Aug 2024 17:24:15 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 67A142825FD for ; Thu, 29 Aug 2024 07:24:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8C9F18A6BF; Thu, 29 Aug 2024 07:22:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="QJfUC1ik" X-Original-To: linux-rtc@vger.kernel.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2062.outbound.protection.outlook.com [40.107.117.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C9F118A6A5; Thu, 29 Aug 2024 07:22:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916174; cv=fail; b=TejlRfzZd5GvG03YlYDnlvdiiDG59Lcp22bdRWOCszUEQt0M1yuKWk1s5x0oIA5D588IG56RcJBpOLCBfEBfJZ5Qsj7Lmq6TizdK+vAUBJI+EpQSa3muaQMBJ+GzidReX7z/t0KkGy08q1GHDnaRgQx/70KKnYD/OBc83AnOksI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724916174; c=relaxed/simple; bh=fvCeOzM/2tr4R/2po+LbywdYDT+YQHhhT05977+fto0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=lHfrKiQZzcq0F3gG56O4LYagZqpDfH0/TdGTGegQ6LmUlxrTmURnWboQ8KYWHUjOkRsdP7vvNyHiwfjwimmP/iku8hUwTaY7hqy3zqGPLRJfuWC+JR7GzkgYemp9F5RJ+UpwwHkfJ69K5HbGz3cvkhPM3xTeNtMcLqHNOX/oDYs= 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=QJfUC1ik; arc=fail smtp.client-ip=40.107.117.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Hgl3IciXMPNVjw5SvqeT4m4koxqnaLBFmXOjpxUqsUg9vXHqUN6yjqU+mjgiPzPL3ZaBCaQ+fuXh48qhsZc6DOdrxGQqKwGweIQbpcxcPTAp69IwbIBLClf+kRF+4Epta63EQbjEcb0eylmK7xwFUe1UzJXJC/9au7OX8t0XanKiAm4tNISi8SBs6xeGSE1Ync8KKX7tZxTDNqE0dArs7xVTYnriGuuuf6MJw7D5jVzO28rvL2W1ZxVJLRnAlkcxnpi5Zy8MyacIurJroPUSgSDk1tTigjlu/PG3vsPj+8w9gRUhjVSQ5kqXPmbci/ZZbHXdOr5+584LecSLKiyjkA== 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=S4MgaSh04cww1AoAKkHYW1wtHKetG+6PDnyMgMtff/w=; b=E4Ew2kLYP0riC460vrbAXsEj7/PxY/rhj/8HQoh5TdRxxeIAyG1WfWBWf15YXrl0BNLtnIRYjsUUemxIGqh1KGrHfbwsEd73mDq8uHCW0nSnoj3nQJSVgWgBmAzPu2X2JJ/VCIMEOKnA4GSrET5fawdX5tIZRSIlDXVGkOqvvdqXLk1KmhzI4WndvBjP+cP2XGVFnyfgqffbvE21p1i0IzT2eQv9vV9kyBsQVa9TEQSJFBZQpi9m3v8bOnDKh1PCI5R2msoiZ74GbtK6g6RUo7156b43rrtf8SrC8tddHejGYV9IF5Go7eMxFAxSqGjjewnNZvyoXA9q0vF42aJ3+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=S4MgaSh04cww1AoAKkHYW1wtHKetG+6PDnyMgMtff/w=; b=QJfUC1ikyMJI7/YqXQ/9RzgunMjc2Tnrnamul2iazpEB+U8C/4I4At+y1yzPN0bEP93mZRBRD1UMMaIEThcbMmN5SiXswdWDZ+R3097BoYdhLP2eaHIvGPWRKqHlkkLviEPqFDmj1e0XZBbVqNJ8w9WYVbrAHEsuypROURWlAq0VAlEPFAU5rCnuAMPoistv1zZN3n6+PC1gu3AuOS/AvTaoJvZyL8ozziECGDmhpWmH7bgFWy8rCiseTYzt46+leX1OuvOJvkE0/42P94aGGQe8XvtqfFtdj3PhCO+TF5bf4H/XmyPvvJX8jgdOBLEEZu0u3xTM7RWX6pxFGfZSPw== 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 KL1PR06MB6789.apcprd06.prod.outlook.com (2603:1096:820:ff::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug 2024 07:22:44 +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.7897.027; Thu, 29 Aug 2024 07:22:44 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v2 7/7] rtc:rtc-xgene:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 15:22:09 +0800 Message-Id: <20240829072209.7253-8-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829072209.7253-1-liaoyuanhong@vivo.com> References: <20240829072209.7253-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYCPR01CA0010.jpnprd01.prod.outlook.com (2603:1096:405::22) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: linux-rtc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|KL1PR06MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: bfeac169-8e38-427c-6a7d-08dcc7fb5fd8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: iFzcvrc8z2XIDRu0Ci+YVmaizOQquKK7/zVXP9gvTVJ/P8uYBXWBkv30caJrAOSvTVg4C0mMDoiCK6t5Rlc5Qv6Gb0BlM1ytHpx4JAr+TmvLwJBloMi1qHdcDCSGBnQujEWUy7+/2Gn8aKB5AUfA37NARBnDpzLliRkudR9W5ZHxHeHkG+7CjePFQoMA1NoovsJ4q3O9/Q0q3ZikJ5yAhgms7/hauS5KBLFPlDVAsT5f6EMVtkYxknBSBDU2Qy2kt/O7Uu4rV9oq93DJrwc+iyDugSGu15bBfmCRxzKtt+8GZKDkcdW4DvCebrU8+5+zyHctllRe1hsIbeYGLGvmSDDYRrlmJttK2WCRRZ6vNSHKOMVO2tt4O7bE+LiWNYFwMnS4iQ4xXcHG58wCJKsgYPz+g5f7vIEm79O1+NHKvtYtBo+hvU2kM62mrW9+nVctRtdk4gEpWIEH643VpSrkSqqr+eIxPM70GVQ33VJGXLjDqRHOr3YU8pHQd5YdaKzD6eVOd5C7v+LcChPSRlexM9uZUj7AT/40aK2RPIKIedRcWrWHGN65HGluhdRPk1nLFusQBkwumwivdZCL0Z14Mg+aMDonXV4iA7Uc4E4S6xXOz4gvoHwIML381vW9Z1pZquPhkax7iWNlIxFk2OGFNkJfqNwIjtm3Mg1AzNlQmumDiLjq26AgBaiL+YxaC55Ixj8EQgRXId9qaTAuvFZyF8bheew15PCncdjSTdwWdrWk30fga/RebAJwmdjhyWSjOVvWhrPyWm2zxopZfDxykIaNiMjpBx3MsLLoxaN9o3xrQi9QKRezqs3yliP7IiBhmpyQ20Wf5eCsmvXxb013/Oj1GAyOZbwo8R5VmhJDrfP0+mLVDmENBmuKN9wuKp53oDYqKNuBdEzMPtHEPxaFKRu+Zdow/sRzSHr0hHFizsapiUVUU6pM4AQKnHXYhSM42WZg3xCSQXCbBLhYyoXJbFa8puHSfOnERSUd+cZ6LYsGkPYJ3yHry5MGTmMSJh97g5UaFvzhfOTfYjb8dk0LvrviCW+IRDMp3ebl6J/uiA2qWwpaY4/iBFPzyPQmJgA2/LZuz0B78fxT4PMC9BtS8LijTw4Pjg6nQ6ULboXFyx8Yravd3fdPxpk1wijbFx33Za/VH363bJ0l3gm/2O6HbQUUlRauEG29fBdr4HfgY7l77VY6y4b2jt/NydYibhi7J5y6yzjniP8OsDxLCvyHSrnjLRPgM/zmNAa2dH/W7tHwkOPqvEsVgMnnvRHXaXFXZZvHmuCAlOnHwgJZlbfMrtjkFNJyDygx51Yhhv96neOzzlz9Coq+jBmO12tIrTN+faM22q7WGr4weagwCoskO7w9uePLXmjCA1EbzESyjT4N6UVDuRP0XhsGfUQtkAUizEZuRT6M/AtOGA7thT0Tsw== 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)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4tjrcOyz3FfosVHLKA+Am9U5EK6scKkP4XjPSC2LSyzw2BHUt/bEUd6eiQK7eGqIgKce+wIjUIIcHqZT5zRciOL44VHbdz2EJEcUiSZ8Tuc2PZicAQ6CA6HgWyEDFjMELwJbdq4aauymnaddjOFgrgp2U1wpL4hO2nKjSOnsqCCnTranVucewYYqFXIrJ1/4zWNWcNuK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OzpQeSfOEXCzkah3QzZgpIZcUeCcXOWuB29oIK+5fxA/rGwMk7yOa7sqfGtKCLSLWyo8D0f37mNj/woDaNNglbEsElKS/+vp00OoFr4+b9QOPIoTu28ddrKv8ypE67UxuDgPstuvHtCAFipWfXXir59+E/ojzu0QnlyA9WQIQ4vPdakrEQu4YHpNXdOFixyGaqf9JYxlB97UfZ7jdBMwk0p/hGcf1aGH6ByuwdEl4pAqLnbT9EauB3ow4Z6qDyIpxTnueVIa2u8anrpHyIsOaRtu9c/MFy4bgyoSGxvmE2AZpQZhlZQnJ97KT0aOHmBk X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfeac169-8e38-427c-6a7d-08dcc7fb5fd8 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 07:22:44.0171 (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: QJ7NNVPI0CHtIYaQ0/sjg3Xx1D/jUgbOyhHwN+TgNPDtnpOQqBsAnd+yVVJPNIHuem0xAJTXoSK5t+fvt39lPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6789 Use devm_clk_get_enabled() instead of clk functions in rtc-xgene. Signed-off-by: Liao Yuanhong --- drivers/rtc/rtc-xgene.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/drivers/rtc/rtc-xgene.c b/drivers/rtc/rtc-xgene.c index f78efc9760c0..cff29d18454c 100644 --- a/drivers/rtc/rtc-xgene.c +++ b/drivers/rtc/rtc-xgene.c @@ -162,43 +162,33 @@ static int xgene_rtc_probe(struct platform_device *pdev) return ret; } - pdata->clk = devm_clk_get(&pdev->dev, NULL); + pdata->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(pdata->clk)) { dev_err(&pdev->dev, "Couldn't get the clock for RTC\n"); return -ENODEV; } - ret = clk_prepare_enable(pdata->clk); - if (ret) - return ret; /* Turn on the clock and the crystal */ writel(RTC_CCR_EN, pdata->csr_base + RTC_CCR); ret = device_init_wakeup(&pdev->dev, 1); - if (ret) { - clk_disable_unprepare(pdata->clk); + if (ret) return ret; - } pdata->rtc->ops = &xgene_rtc_ops; pdata->rtc->range_max = U32_MAX; ret = devm_rtc_register_device(pdata->rtc); - if (ret) { - clk_disable_unprepare(pdata->clk); + if (ret) return ret; - } return 0; } static void xgene_rtc_remove(struct platform_device *pdev) { - struct xgene_rtc_dev *pdata = platform_get_drvdata(pdev); - xgene_rtc_alarm_irq_enable(&pdev->dev, 0); device_init_wakeup(&pdev->dev, 0); - clk_disable_unprepare(pdata->clk); } static int __maybe_unused xgene_rtc_suspend(struct device *dev) @@ -220,7 +210,6 @@ static int __maybe_unused xgene_rtc_suspend(struct device *dev) } else { pdata->irq_enabled = xgene_rtc_alarm_irq_enabled(dev); xgene_rtc_alarm_irq_enable(dev, 0); - clk_disable_unprepare(pdata->clk); } return 0; } @@ -230,7 +219,6 @@ static int __maybe_unused xgene_rtc_resume(struct device *dev) struct platform_device *pdev = to_platform_device(dev); struct xgene_rtc_dev *pdata = platform_get_drvdata(pdev); int irq; - int rc; irq = platform_get_irq(pdev, 0); @@ -239,14 +227,8 @@ static int __maybe_unused xgene_rtc_resume(struct device *dev) disable_irq_wake(irq); pdata->irq_wake = 0; } - } else { - rc = clk_prepare_enable(pdata->clk); - if (rc) { - dev_err(dev, "Unable to enable clock error %d\n", rc); - return rc; - } + } else xgene_rtc_alarm_irq_enable(dev, pdata->irq_enabled); - } return 0; }