From patchwork Thu Aug 29 12:14:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978405 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=MSvBRsEF; 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-1771-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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvgGY0rrQz1yZ9 for ; Thu, 29 Aug 2024 22:15:33 +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 CEC07281214 for ; Thu, 29 Aug 2024 12:15:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 815C91957F9; Thu, 29 Aug 2024 12:15:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="MSvBRsEF" X-Original-To: linux-rtc@vger.kernel.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2084.outbound.protection.outlook.com [40.107.215.84]) (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 BBB4315E5C0; Thu, 29 Aug 2024 12:15:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933721; cv=fail; b=G+pMhblb+WV290qnvoO8gNII9whD/W+VS1NRhESqpMiLodoytMRl7vkIaw2xhbDobxjjrFumK1HVvMesDNvrkAjhmL3T84wXdStPmHtqhZ9ErkFv8wKFgie81rZMNm3tAvI//ewaBTL81XwIA5OQ6bOgCHvZMGlWc0Muf/jf2uo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933721; c=relaxed/simple; bh=bVEEBr4ewNWxP0v/L3lvL1Vdj/Q7GZjpzFEisYNxeuc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Q3uM4lXrtmgS7oF89w4YAZT5NM2VZrqFzvrm+WkN+4uwg/pqs1r+P8HnfPGmM77Dr0RfeX9oksQHua/2R9Ei3NX3vBp2FPNAECwimbJr6lfs8Qy8tgHUhfB39DOqZPvOX/YI1uM/slDIlT+1Tj2pE2voHDxVFwbEOlTAMmjBjkw= 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=MSvBRsEF; arc=fail smtp.client-ip=40.107.215.84 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=OKitntKXWxKt3NeJPVoYVLlu2b9Ee5LjDmR9IJYGt/zvRRHoDqn01Whs5+uqNsSgUJABDWLwUp9akwGL6oQNjcGoPw6DMYJRtbTsi7F2cDiitgZUWZSAhg06uiZVOzIVUCdbyXdyTtc7iJo+fGhE+NWC/caL6HVqY3oUS6sKy7Rp8AQtKGGBr8Hf3n+oTk+gn4E4gtg1XJ/qLb7oMH56QkDINmnCVyz0MLI+oGkCWdiEm+NOX8/7KU8I/RdQOl5NmHkv1Ogy1G1nn1KMkdo1yCP/UANFTbe+M38RzQlpA9zbhRUHqwte1TeN3mcdSbVhJinQgJd05pmEw/RT0OiJyg== 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=mTEHMETlqObJZ4igix2dGECzP6TFxWVJLeL5mRwnSmLvD1Mxhtom7jHvcWXavMZH6zG8cEGvm85QVXHoL5zTi60S8KJRJYMfpeK3zYLkqtv0uDmwsZS8ZW624Y33CgZwySiN/H+scp864Yq+XLEzC0S7c2UAmuE8Zr/havV4bOsMu3l3NQJxUjCY33TWpi+gXIy8VyAFy6BGIi6ZHhYtYPCfMe/EE0Iwekwjskcd9jErD4xpPIhCmuQZDCgoIKQmRTpo1oh02c5HTMJV7JGiRdrmQMrZURlVFoJMqPDgvNPTPWGgbN6/SDMp3DE9l99vW30xTzbny92DH0fH0/1PrA== 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=MSvBRsEF1mgfcFPvS4plA5YoSIg0KAplOkXpktOe0gxqNPkPFmc6LejNYhWNjPqscavGb65DEA91jepueLYRgz7otAptFD3houTweIgaAEaKtRVaKQ0FicPqxYBPCn4SnysUaKfCFDXfGFaZy7srgFDPPF0bdoomUhbPaDgPLZ2xNp9WZzGaCfsuNxhsm3jHTSYppxinPlxBNjACfeUDWSEDBb4W5OrZS5tPZvgia9QD9Uenw1Hm7gqnBm9c/fZDvbbTOioPv4VcAao61OwB4ar5O/1grRUIZAOpxDZjzWVsc4h6byflRqa0eO6LJGZZJCcxT9NzsVtEi6frGjltlg== 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 SEYPR06MB5352.apcprd06.prod.outlook.com (2603:1096:101:68::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Thu, 29 Aug 2024 12:15:13 +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 12:15:13 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v3 1/7] rtc:rtc-at91rm9200:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 20:14:49 +0800 Message-Id: <20240829121455.16854-2-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829121455.16854-1-liaoyuanhong@vivo.com> References: <20240829121455.16854-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYAPR01CA0156.jpnprd01.prod.outlook.com (2603:1096:404:7e::24) 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_|SEYPR06MB5352:EE_ X-MS-Office365-Filtering-Correlation-Id: 7dc13fbe-9f6e-4b2a-72d2-08dcc8243c23 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: g4jNOk8lHfgtYA/M0BWQzg3bkb7S75vDCHTQZ2/rdg3r2LrPK7vfP38R69hLwQ5yH0CyBEeYSdAIViX/hO+f5t2acmT7+PmP5LJqEZ7ybJ2XJnxm2rabFtO7qC/PqwHWD0x6eLqiM1/onqZpVO2k0WupFM1Fo4DEgdEZJmoqq0wTBz2eLSgDVnA00ziADZoKY9QxNPxpwMLR34fXlXGZJGhZXfya90Tm2xpcV/wcjORikxOJ/zeMc11SgJ70HbURjEShzne2u4enQqjTXVmFKKJeKCFp43q7UhMO6oRiSdHlgKG50F8BL53eQThaAt5gdEK/pH6Ukh/56zkrALFfvAWjmNYAaruS4s2rzFvRRlrhZQQmt41H9WNB/or2H9bdBzBnEDZpXpoVeX055PveH+xXMKxJWI1uE8dLpHZ7EMIQ4v6rK0YFSEJS/As7Ml9EOPG8TFh3Q22QlCctfLIHhoHwFTFNUmR6CCmdnvBUSncbGpFi0k3THrpUTz44tD1Xsx1Eqcm7T0oaoP1cwndcQ8i2buPIzfIrgL9viLB1E2oI6OEfFGHWd6ZPpvuafSqia1ba9sdmKxIMeuyX0iIhzDUDWPSPwJGKsHSkHTb2ALstrfCkelBTPU0L21Kx0B0L/f8wEPsIqbId1bHJEXNsZR4MZ/GjU7w13P8mqtdUY8vUbioiL8gox/5FhkuxHdWVKmK7PdLHrhizlQgSlrMLfKBAuXsgN0v4XV/+G1rBOkCzp8rNbFBgp0A1777aSS6BADlZLEU3ZFAmfAW4xcY3yg2IN5pAv3ER2RRFYfmVlDF5NQPZefjJaqZtgP943yRp5iscrYcPX9H8GPIUQX+C0O9t6rWkR6bBj3LD8uZ+xNBRNlI+QogkG0/jt1ZD56yUJ/o5VWJsnMM0TH6OLT7KOp0z6+OgseCCUScqi8haKq3sckQ9JRB1dSUmnBlKU66sAnOwLX0BP/9dfKh+mJP/gHXQIDMhmEnqr9c+EXyyIFY0wjwXUOMWtcPs1JS0Wv2Y7lDFV69EedZmwP+/a4L3r+o7qXR3mPTcHOfYL7FMLOUcmePvBoioc2rz/PVD8cNtFDpG3ZCBDDZC9fG4eJTRxaYFM90MqsauBmXki80mUTOfF4W7WJdP6eSxroXAOWYNbRFpZXr3jqilquVi1ENimISnZkTLyrqhaPyZxm0cI0rTVoIy+AwJyk6VSXzvMvXum53aFbALS1ycaM1lXIt0yjz57jooVbsAneg3mu9ET/L040JeQuWQRy/LPQPgnLZcbugl3JD3Y/B77Mjuzmi+w0+lm3CxtBG+6s7TZjYsgi4LPWEF+ae3fprbTSzZ/UuLh58OuzSpO3SLTf1y7vR2SvFa+16WQhuVIvFSp5K+lXBFqiTmaeMl87NcUcsAGr7NRv7hUGztY/M8NHo4hnNTVw== 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)(376014)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RI5yGeAdbfVimMBeVd0LqdxkkNNKUfQ3w6hkP1VVOid5i84fSKz5NZmuI60uv0BtDqFzQNFUlsfMRMJKalkoY/NI/qj70TwbQrk7s4mR6L+pR14jz1B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YutDA95gdXhb7vmobjoOId5kQCPgUvIqUUS+6i5IBkKrmQnbelVHundnwLkMAy6Y15rLhs2ifRAJkM1Fg3n95sLecI5BP2ZHjVI/8nIH42FuhR4TTAH7QkvSTyoWTIQO0gieFb+53K5MZNhJgejsParkhgW+CGZP4031YUiVyDqA0naTG+DulOiJSqivPaeC6VY0gAkcmL/ftGOJ29AbDNu8uZoYlsZ5PsDUnjgo+XucZT0jjCZztQqFXcP3xB+lyoIb3UevoF1VzeSdZP83EdmaGlKKPTR7nro7OhPPm4Mnk/i99kZc3CYgNKiiJkuJsNQZSGHMKO3y9t26Tv08vw34a7jAnlWhwq5WzIpDoHyyqVIGu+YFwJtHas9wXTyLQGEmtRwcS8BCKWkiHu/dk9581CbHMjjkb X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7dc13fbe-9f6e-4b2a-72d2-08dcc8243c23 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 12:15:13.5241 (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: PvQyPuc3dgxGBsZ3SWsIz1mkb/3ozAsKd1SvyOX9G2CTFPcttWjBBaH7+07hE3LeG1dYJKUFIEj5mx5JRTVTmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5352 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 12:14:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978406 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=Bk5enVp2; 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-1772-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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvgGt2ntrz1yZ9 for ; Thu, 29 Aug 2024 22:15:50 +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 026092814AF for ; Thu, 29 Aug 2024 12:15:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67AD0198A07; Thu, 29 Aug 2024 12:15:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="Bk5enVp2" X-Original-To: linux-rtc@vger.kernel.org Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010027.outbound.protection.outlook.com [52.101.128.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91C5D197556; Thu, 29 Aug 2024 12:15:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.27 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933724; cv=fail; b=J+t26CawvCQqlIEAl/ESvJWIxjWFt2JG9151Symn1sWY6Zk6K2Dvkv03Z91vbeSRn1/4HYO4t8BmW4EpSArjiKjHkJDPkl2ISO8DIUtbN8iR+WvH78byGCWG1a+Gi1LYzPgRsc4S3+GI68b0lb/oP7rGsRZWJqu6g6N76aZ4VGk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933724; c=relaxed/simple; bh=IbNEFCZxiqwZqn/qeK5t2lXr5khkPyJ7Ke6mq16MIx4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=FHeB44zKBb32irLOEycq/ppX9A6Qx5NKJMh+wtDvh5qxQKopI968LSiJF9Tq6UfrfSS+0vYa6wWUb79dETxWK8XPtg13HkH0OlgIZOesIXLoayxgHZHHYwBb5Es6sUxh+/w1XavWp684IKcHbPGv8aSZ+0oIi7lLEvzsCIKKPTs= 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=Bk5enVp2; arc=fail smtp.client-ip=52.101.128.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KRejuEpsE1meYXlIFzJ1/Xbb23SBKZwbWi5ahIW1oYyUTI2huPSVON2c6WcQPoSQkZN12RI5N62Orw6m4+8FwG/DVZOfzqYThkd6i7E2QxqSSd9dC5IxuX/BPtxBjfNwYX8ELjXn8/n0Qw9mkm4AjOtZcnSoPi7vplXRmWHt9I1HKvpDxqG1V6Ps9RCdQRTxZE20loN8o81eQfCPlE6KvztrL0BQHyJJy3pdvG+2CeF9JhnPpSOQogXyhoBNHPPUq1X2lEZOFcOfVSXG9c5hR3Z/EMrQKC6TuOqzjxlOH5ZWgM/YlxcUR9uobYQoo2BTuCftvVZWdjKRJTvUzlOavA== 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=e3rhTwKsgPs2LiOrPoW2Plvv3eWySai4ovHvNIw37GoqDCjC6bD5+0JpjhPkLDP1hr9nF/Ae5dV8p4OlImiX5G7HXT3bHm5PcQfO5Y3KOSxISRMSG2B5ES4pCcJtVghQfDIAXtYwSt9iSxkZtQM0Z+KAPGipLaYdcEBSKlE5Q5uLqF3F2RxkPmOxgjlcenB5J0H6QpKeGxW92gXGJNApllvwCWBsYBLy2dL2kxQoVhvrYAYsSAuUMCtWdTcafn9Y01NBOH+9QLv9rkXWPYbBUm4jt/oc3E+mjOFmUdLmGUAIfRqnia33PLv+YL6AK/beQ9YsTbD/tVgKEFm8MBCt6Q== 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=Bk5enVp20Fe4CSsnNMnqlE7v5b8PTBgbgTNcXE79j/WoywKISj6URwAFzXari0d+bXbPmOFodqqmDrdmP4p7Zr9ifwn0edNw8RfLdk9ePPf6LyRqGuK0wvuTqnYgqXJF331TL0Rz5Rm7ufysH6SzW1ALShwV7geSILgaQUr85SLGyR7cfb7vcQdtk7FCW/c8853ysY/oJu8ulzByVUHlQX3me3BDcXQp2fMXy4EdjJxlDZP2t5TWk0TYycsgAQKYdZ2BbvxY1X37FsZj0/hz+P1u293IHDLAyEQj/JSAvd9mxwO9fWiCVj9H4t+7ESBhPcCpReM00VMRTHmWxscoIw== 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 SEYPR06MB5376.apcprd06.prod.outlook.com (2603:1096:101:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug 2024 12:15:17 +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 12:15:16 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v3 2/7] rtc:rtc-imxdi:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 20:14:50 +0800 Message-Id: <20240829121455.16854-3-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829121455.16854-1-liaoyuanhong@vivo.com> References: <20240829121455.16854-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYAPR01CA0156.jpnprd01.prod.outlook.com (2603:1096:404:7e::24) 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_|SEYPR06MB5376:EE_ X-MS-Office365-Filtering-Correlation-Id: 431dbb0d-b94c-44fc-d70a-08dcc8243e28 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: zM3sSSSgsSmCLbl1Dav23irMYY+uRYZt5etQZDN0g3WO1qOiwG7fXSAvO0UoNxFfpFJ+LwTuthRReX89du/dFeC1pAdb0jAcdQxEqSpNbyT9fRYaOGG/4Ysiox66ruARng838teNjyFY4eKrzAx+lX0fl+3iApMRxiTuIO4w+khd4A0grOTMUSpx+DOoWuzelyanz57wx7hXmedx/uZp2elDRtfoGyMtJXBq6WthA/E4W6CdC5RATYa9ECqw/NFtU6o31Prj0Fo+pEt+B1ndNRCAwU8bewl9BW5vjDqVDUNcGuUw0Awp/FvPiU61/yCwVA6nBAiyi+zi2eAvjWqAe/FnJU7Jte6Skn8mtjpRxmnByMPEjjl4ToaA4Nu6dWIrUKN0UMsRJYv4sRNMhtpDmmdFTl7Lp5LgvoYStWcLc6+O/1uGfXXJXoFG2vVFdWrcSiIUkyRDbI12m32m8cYjB7Spule9vnW8h8XvbmtLy7B6VG9ldaNExSTNueGiHdBSGEVNDJE4+JXBj6w896KT6kVOxid7u5+uY2c/ED8ZWU8oTIL+TlP26Y2gV8P/eAr+kfpOkND28axHYNKJNUpYBNi2PUv3553F1icXk//iHXW8I6cloETnq9TqnaAGNjBwvwuGhDdKMcRMTwKziPIlBPcV6r6APdPNkQSPe/T5iqnLW7VvygbNQRBku7rb8i/Ti4rqcNu4uCp7LDtC9raC78VZboS/K++BxjkGA6vMVQfDpoRNFAZq+BbMqe57W+5le5W2iGa8apIS052lkp9ZFeSNaU9csSLTLVTsQmUdCQCWNsfa2PqCX7WF9Mqq5oAb+JFFEYayIIa/pTunDmSmoSjiCIBlGCn94zMZoVGV7Wq5owtgdrRaQFw1MUCLX7hO7+XWUK7dKtecDMRfBKCqAYYO6Uyyu3zECM2NS3B4v8cop+UjT3EkRD5sEeuJjUo66WeQdO6HU3JQVktioMfkcp5U8jZ2NaEMea8dpkvTPI/XBp8wxzu82DwKtMtDeKCoSJ2AvcSzHO3u1TTMZtDpe8GYqLD7lQWOSIubP/ngmMXUOp547v+f0Q8RlxuNzPMsHl7q2iLmPri1FfS2vPHQxpSijFlSgRSS7vO27ucKlhThMglxSUUcrPiOqItiaaz0MS6WpL4pR1vAI++H+3ebLiEJOlxcsUQT0sRoO1CvrPs9jemmMTw1ZbwnD453ro/dXbOmn/zBy5G69P49S94LWlU/PVEMuaJUGPsfRGMA1LU78s4vwWTJ1xWvVG9vrOdqlcmdu6FXnJYhQmkdUBJN3qrb2EBrEAWe/SDr75FYZmq5j9kPwfF3Bzo/kMiZxG+j3jaFUXHlvTLiGwNNQ9JwQ9+269nZ0iZI667IWlbEuL7XlqqVUpBrVJfHJKcNkKKEVNFFPNOxuZNRf+Yh3zf5Pg== 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)(52116014)(376014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Hsl0P2V5TiMu3ZOK67w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KtphAwpdZ16J8IhDLZHC0C2E2Bd6GcpurZ5JzKTqTNbUhBJy9kLsyjpaucdqUfBIHPZtGFEmPeGCPvcA1l5+kMvhMT47PE2VabCNX3AF/pwL3hYulon+mr8wojaqW/Dc/2fJoNz9b2ejMduC7lrVsDjzmir7Ilbcv+Ynvhb8sUKDkrdiU4+f1rd+Kil7PzYjG29GL8MHGOECWLPQaAjUMgsouW2PFxyIAdzP70JUvMvaiHK+WNlD64DyCkNq+Cjm6S7mMCzvGsfhjKGuc5Ao/UNkgGYopxUrmydvIcvV+dQFcGSCPHlcQW3PKizM95ofYlotDy/Swyau1aZ+BCg4xg+F8T3OB21iaR7sSpgmkxMlYwjzauz2M7lmSEmfB+6c4OuEIo/je7LdK4LnpBtE6R8/5szMwzefLAdRkDyf1m5X0mu+YQe24H1Sd6DnEV8lqYy+LyyoWmxli+kNR94Q22UR2Kb8cVaf1Onr4aWi1UwfdO5VfJ8hB X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 431dbb0d-b94c-44fc-d70a-08dcc8243e28 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 12:15:16.8752 (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: bPf5rYyzrYOeQYYmNa5zVyUKX9QXXjF/S1J/9rvF6lDg2MdTaZYnoISSoqKeaWqj/rtxB44MHHPuihRb8fw1TA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5376 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 12:14:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978407 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=L8kV8NMs; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:4601:e00::3; helo=am.mirrors.kernel.org; envelope-from=linux-rtc+bounces-1773-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [IPv6:2604:1380:4601:e00::3]) (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 4WvgH81Xvmz1yZ9 for ; Thu, 29 Aug 2024 22:16:04 +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 D12BD1F234C9 for ; Thu, 29 Aug 2024 12:16:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 760EC1A0AFE; Thu, 29 Aug 2024 12:15:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="L8kV8NMs" X-Original-To: linux-rtc@vger.kernel.org Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010027.outbound.protection.outlook.com [52.101.128.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C27D1917CB; Thu, 29 Aug 2024 12:15:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.27 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933726; cv=fail; b=bokXh7cVUlp/ER1gniRaOy7jyr4L+tUjPUddlxKAXjtK92RMENq1mX49zkxNw9MI+tDS9sYmggCJXW/r9sXk/q4YR3zM66TRCCcu3t21Ug3iWgm45cwph/VeGgjKjd6n9sI6P51/ABA7fSU1gb4Dwy0CZ5chPsENetV5k0N2U98= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933726; c=relaxed/simple; bh=cT6lZHUXAL3M5l4p5lfRnf3CleaDt4fo8YrTbkKBtlE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Rf+5fR441lZ/XUYrG7Ql5VLBPb7XJKaqdTo2Cc9gSPoRbJIeRd/gbPcxIu81pEFUeQFBsfoq7NbZOGlwrc5t7lxCbiaD9CbY07A3fdYJ5jTHn93AvjLRgaT0ZHkazrA7M1OQ3m1acSenZJlT78XK1FQKAFJ3KVa8tJ1lR6uIlvw= 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=L8kV8NMs; arc=fail smtp.client-ip=52.101.128.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XwYN31zF8cn3+Ym8y3vwYmzWFyxdNOTq5+zvqSG2cx/8sBG6vQFhtlfsYZo+ctvX6ghKUzmrP00aeUpjADqjfZ5umS95LbMRwmib3wqukheRejEn/qJY0tbgjJ5+3XxX/xY2NSh4r328uzBToktYWHW7uGeAgLk07mswIcLJ0277sIZqYJzdYCOObpfefLrf08aR52vz/twrvkqgd3QJU/dEzJ2vg38Qts1w+UJOHZpL/nkVkHT4+rEzAeKgKfYnbi9ak4y18tc+qezjYdYMBJqJLmtvilySMqT3kwYpyNTTLZwLy96Sn0Ex+8vFstT9QPc122Ef+sEES5CzEefZKg== 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=WyXZR4JLybGgCC4AHRS5c7CsaoduqZ3TauxAIGIwUM04X9lPNMv6cQz1tL8eWb2DIdxHBCvj7WArngIXtIXTUN6S7JNJ/GWp3+w9Ix0zUFPe+pvKHb45uuxZMTj4W/0G8o5246lqPZtbA5rqFYXJv6ffDcE/gCJNJkS3EG/CW0uomb4of22xAG6uJrD+7EwPf+XgqDatFM3RVnjLuRybERJoVWS5FfW2/xcmq7YcmQ3JAV4ipqs6IOqzuR25SyBqmWtsqThL3+QVI+VBrL7HbTNeJQ3vs9rIFhQnMMbu7Vr+ijccU+aYZmH/gzPrdSD+jvKG5b5Qb5ueI8bQ2D9aTQ== 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=L8kV8NMsj6WU05gb6KsaNRgy3GfcrrFAWfZ+wSYDjjRkbRdUy5CTdTxG1hu4tC2aGZ1WIxyyVWYKAYb/7iS6XITe1sZsumN3Jpq1VHEAmDNnHFkV/c8k4WIqqDJdMW4Zp2NgAN3NnWtdIf0XIHfrVCZNpFJI3S8a+b9o1mxIznjY38AtPrbVxu2zEwmRli5sQECNfiRWcVDr1+N8jKhyhps+fbBcFIfc4Pm54flIymhNC3bSSLskLACIdb1S0uwtsyB5XTIBjCfNWYTbhm6CrEC9VyPPfQJSIEn7QWuNKHTZqMGhcImE7gOsMGDCT0b2EUVT1bG5qKqyzZamGVXD1Q== 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 SEYPR06MB5376.apcprd06.prod.outlook.com (2603:1096:101:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug 2024 12:15:18 +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 12:15:18 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v3 3/7] rtc:rtc-mt7622:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 20:14:51 +0800 Message-Id: <20240829121455.16854-4-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829121455.16854-1-liaoyuanhong@vivo.com> References: <20240829121455.16854-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYAPR01CA0156.jpnprd01.prod.outlook.com (2603:1096:404:7e::24) 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_|SEYPR06MB5376:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e6e6866-4e68-4a28-8ca0-08dcc8243f50 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: ZApJmtk4rGFCGpJUGIhNtoS5K0IL+IJVaRyFYv8LRbU0ooOz+i/6SXPqPW42VZuPeQSSP9rp5+AEYpXFEsxNFUT7Xldhwm+HsHZed3Z185CfKje1Vj6nWoGzgjGZ+2jVzZtewKWfIceUT+0XROUwDXa5MUCPkM6LCgMMjGPCozOgp6aqtmHDut6UkrGoDRrrY+g3+W3CTkLVe4ekAl15GLWg65vrcPc0VqraSq+dx0DjiZG4Np9QA7RcnSwjQ59ygXFrVb2oZ5JQ35y7ciayvHH1wWZUZ+Iq31PVvWYS9gdkKhxfgBrIn16abH3e9xsnANHt+j/3xdYsMGLK06OlAF5e5Hdc3Z0/mnBfReb9bPymPpe7aPvgW9XqkWxVS4g2Ls8RNPqNWfiCSMVEezGHmDSTksPnm4jsmRQK8Ml0OiyxjLdt8eGqv1zkdW1BReCgqWwwh/5bN9htgi+5bSBEXsFvFSK5X1VJpqWqCmErVHlC838sgjgbi4qeGg75uRxqBlFd5KpVma8cVC57SmnFcV6gUdjfd0WZESrM+bi4TO/Uw8g0DrYHdJobvvxvwKFBfG5gXcC9A9UcGINdYiRWJwMFuRpWU1wGTR7EnxU8NMkkxMA7VouC0cbXS6N0/MpJ5HwSz8xWq0b5VvdoecAWyVLqoE4LRLBlE0qcGhvlzfTzjSOh9xYnYXWd2/rP6LiA45WS/zwhp7A4m84o2BnK745OWdV62JuOgUGfpWQ+2yStz/jXndhpzhLrD2/AMMytmZSZLF0xuZxFu1c7/pPaG/ALvUl9rDmuUyD+PC9lii6lwk9kBXndtvnN/Hepo5v4uJl2IK6A7z66r98+r74B4vhn4vOscNCdj6CCo6/P82vZ6xe3jo7M+FRH3vTnypBBvuZJPGk2aomCO9rw2IL0fnTP9bLAHZp6WItjlkXpAIdYic595uhggJoY5BTlpwsT8jRB3kCscRFHVfZhSG8Q97uCnyt+PGT7Nomm6yFNC++SU0grEuhIcyFnEHeExR0IcJOaaprAGwo67DdGfval9aLW5j2vZAeH+w4O3P9Jj0t/MehY164G7rkjryKbfDnSawqiHhlArf6q2QziuOXm2yNst4iU60ZwwnXhAtTAyR3Hhao8U8KfPVTZQ4IU+YjRRhRzozdD8FGZJ1GLYFoQ3T1lLcuT2sloLSbC0ID2yx1bVnStB4b0VfIV0MecdJlQNVJISMHYo6udQcpXU2EJ7DoqJxEj3G4pxVfXacHG3xrhcEZs+YZGT45Evp5mxxBC7HhQbpzmPbUTS4UETmVsV0bybaAC2rnDPrTLZ7/YbfQ3QuAqb6kPC9qrcrizZvd+TV4UB/QFVcM9d5DpyR3nPruPVIndHThZamqzu0V5khOPCMYF4GQKjkGx+yrEvsmgqDv+Gv/DqiIxQ58CfRt1eg== 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)(52116014)(376014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: R+MqVEoztnGSEzwvxDXJ5A6PMSMRoDnMNuqgDmFHYN0SP3JiaZ6BFYDJUA8N6fQln0IiUVZgIk+c9OmHt1pRCPzr1gKBsNPUhga/T/zjp6SfoDFpuwocOQwcZRxSdt0xXVUyq6H8jORyAIIDcuJpA6bmKG4b8hoCj+6sFZ1CSdzIsOQubRVFHx+A+jeMCzdFmVdFjVqCgSZq6M4phV8MThfB2FmjgL1S/R32OmwgKh1I2IzknTgsgqR8cJlDQ0hdEB6F3AWqj1HoYvsVKuaM/VFJ8YKrsbzBQ1R18CWV9FuYOhG79af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cw/eXCNF0bT+fVwHiJvNIK4L0D68zJsuP0UD7z2kuN6KoOzAK+TCj60fbMRnZw0opWffE/G8CzUjdp2+ZzHNIrDk5lTvYOMzJ9JjsXcA1K4P4idhFdp2MnVQ11Z1SAZowyT5hIcvM/a3Ub9HX3r/kwDUWhvd5BQKbyBQd6kmQxql8JpvslxUrgSRk2jj8kt/SUbBEGC4DzSd4KXnk0wNF2cAAZNkf X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e6e6866-4e68-4a28-8ca0-08dcc8243f50 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 12:15:18.8089 (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: NNDnNWnq6525kSUfpsbjfQhqKmtpfpm9vL5JhZSMx+2QP3zvBdBgu8rp37EfVbLQezTo5+r0m6RUjHdzrNyiRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5376 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 12:14:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978408 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=b0OKrm1c; 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-1774-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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvgHL6qvYz1yZ9 for ; Thu, 29 Aug 2024 22:16:14 +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 4F3AFB25946 for ; Thu, 29 Aug 2024 12:16:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E7D11A3BCF; Thu, 29 Aug 2024 12:15:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="b0OKrm1c" X-Original-To: linux-rtc@vger.kernel.org Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010027.outbound.protection.outlook.com [52.101.128.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A1BD61A2540; Thu, 29 Aug 2024 12:15:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.27 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933728; cv=fail; b=j1FnNsHyGB1CvfPASRhbKaV3Dma064xm6fbPJI2C5KLjDhJo72G6ipVwlJjfD53lZU3csPyZsROa6bl2ZJ7xkIvb2QoqndGzhmwquYXnRx3dTpIWg7oZgQ0bgk/eywmgcmxrQd3vY5smZC0d9Jid2Vqz5efh5BVcCbap+mfwjTo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933728; c=relaxed/simple; bh=pBOUDwfAj957ocT1D5WwhW/HJIWvfdLKJC+CdSjpf0g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=dhrVMGtoFUxEwmmQ7e0SFWR1cHLnygKqa2plR+8HYdYChf2QGbmBmtm3zMiXD2sTzHyx84VEysHKl4LNffrDwXN2R8aTovh2vkiziKu84vmRB4Bt9K1/DxMp/QfHA6C2XulY2716XDNV55cdrsdHaNc4hDrkLs9iw2Car3AWL1M= 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=b0OKrm1c; arc=fail smtp.client-ip=52.101.128.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RDzktYH4PK+Z/NV62YOdSTsg1l0ATbt+uZ7vwM6FH4EiBuIiwij3h2jFgD2FEWBvAhTw2dSuvYyydBRbtyoGXMQq7sHQpasq5/MAwV3cWgej1yXrolsmXOwXRiZsNR79iJ5uEiaMO0gcUSul9wsRz9nVSo6rNsgF0E5oP/9sHxWcgHTmNe6HSrE1T6BbQ6fh6FRk79XBvfQis2owQJpu8sOysZK00Eko5dowt16oXiipH9XcCwh2JJaJWX338r5bW5b2GCTFeFFyU5e6Gl1IbA+4HPW6y+dz1gWuPa6rHyEEaajsCBciBEmEPG62ksHo+zrxQQ/DYIxYAXosNouSxA== 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=kjnHXNyvIzx5VBscV0rGBsHOl60GI6WZUoK3IPOxw4AlvC79lXr7ZFfVm0k+UbBHsEewVGEArYe7bj2gGVQOD0prk0efPBPPSJtnunNtizEu/X7dMzyuAGZTXuEs9YbwVlzBtcStemMoDk5vFOkj03XCjsLm52FGFXkC/5gRUSjk5UHEoPjBQjgKKUmDHNU1dAgfjOMxmgPh+b7Hog2vKFFu2NYHj5GfmQKkXbAAUZinnR7qUFrqcCZjrlrqiqLbDt4BSrX/WQmOOZ5NEvuCeTjkD7UfZibkSstAI202Xfpb4/JJSn5r9M/hTYzVoEHic6Ixzd0dxx5b4j7scQfztA== 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=b0OKrm1c7FTzHMHM+y4durnL/gWJodtx/boGFOfxiyJ3QN1pX366zMMUDR62WtLOqrf0tJ/kpldIzveRqdnkiR5QTQitkU12m9giFvkSGVW+O1wLU+cgbkC0h0AM/u4Aa51IqL7/8+REoJeh/LkijzWgpKjBwEiBB34eI695cn1/GcsDmPsqEQNLIF9MBrpnMcoq42iYh+26KMlrKP3ZehtLjzCxiTKxbqp/LS4g3YoZCzlM6ronFdKnz9Oe5pD6A5sa9pHn4TglBFJrHGzFcBApYufz1IgeI/gkKZ7+Iq4KhXdiL121rI2m8AzEYkStYORf+Kc7KzT2rBdANhe+Rw== 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 SEYPR06MB5376.apcprd06.prod.outlook.com (2603:1096:101:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug 2024 12:15:20 +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 12:15:20 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v3 4/7] rtc:rtc-s3c:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 20:14:52 +0800 Message-Id: <20240829121455.16854-5-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829121455.16854-1-liaoyuanhong@vivo.com> References: <20240829121455.16854-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYAPR01CA0156.jpnprd01.prod.outlook.com (2603:1096:404:7e::24) 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_|SEYPR06MB5376:EE_ X-MS-Office365-Filtering-Correlation-Id: abfdcfe3-19dd-4d00-99a0-08dcc8243ffb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: e+062dDFVSIxcsrCz+o1yClN2Gq+AUfTTVosRdF13cHFiWlg4GVm4E2VL1An8qVA7oVWp2dPmHTkL2pz+ZTf1xHO8SHSLCBeuBNsAht9Y/eDjcTivIl/xnuYFusC7o0wdB2bUrhaCvzPRI0MyqHeg7a8YxwuLD5tRnkFJsgxTKg9Psf1GLuZ/TgAu3tGvErd/PNsXGdnq5/4hwvDHCZdF/8rBi0Obrl0r6hM6BeeWJ+YAQcHOMfg5WFeyMI5boRrGfdFSFkQMj2vX3aPTa0YWajtsSnM7uh1Wf3eYOkxYmAyfDhm3O3raEZrMAC6jD8zAHUJXEQaHMKzEJhg82xMiSpvPRMx+UL6NRBX/xS75NDUymj9ZLyE3wqw0KbS0ZbzJP9z4XS4m6I3x+lBrIUAyYPgN16Ma6Wcm6fFe6Yi0sMug6H6hQK17YzArN2d8sR64WG7QYJdVxBumptFTRG7GNBWvtmo0DB5Gl8f9PHkFTWS4rymTjbHetDX9vORCAhtGabZ6p6t4xm7lntJa6TmfDvgYUm9kKKNzqiEpzJwXtmg/f0srA6CGJ9I8NAnUTUObl2SpIJNwtk/87zdmUcsxrdQw8DZMrb5UPzWjPW6UA63cK/C3VqiIagvJ+3xRpP/UlN2QGq6fwD8kmYOnKUDKCYQtCcmIkMKsjWYU5+LHVcGHIsUGunHTairyntvd+N2vTLvROh+wIzGbEfU36IYO30sQNO6n9TpQr/7I1OaP9cl5OyistJuNGPepRED4DT+TvcGTc1L9nlapzN02pYdFwW/5PUozbaSuYE0R50UlD2B5SEkcg5W/hcCCvy8jsJIfUD0IfZQw+vyae4fcX+1uE0yjX2pZsMiD4mCnQgG1r6fOv2QG5bbgeaciqMsZUsY3C+iH94FXHLks2HzrW4UEyxZAebahL5xZEKgVWncA9rDdQBn28Y0fArU/YWKtJhpQskg4LNq7WpceKQKoIaQ0xlFRyT6XcpPVR93e5/bULqJ9oSK+I7H5joQyteai8O92STK/cwSYHAHC6YrvfxTd1nkQq1Rgob88ztOK3zzgxu7i3JcIulSvy8COqKKExRJ3uuO4NPqa7WrsP89rls3a7ZAP+u431Bfl7crXPmP0/hINMrSPFH4n9XjaE+2c/NnqHVaHXaDjztfje+Mp6jVwl0X2OPdNenMpz8ob0e0zngRYqsQzjRcBz6KGSmQXzOjIT/2HoRZdpC0Vd7OfkG5aGsHDfpdk1yFQzNxy5mwmULP4kPs45SnP/pl9Yz1QRSBk4+0wgOH+6Svr3V+aXJi1b5QmgMU04vbgN5Nflm9f7SE1PBWeigmzL5rFz1pmHJGBLxR93/uaSdSP0QinUziiuqN7IlFVMsYojdDr2zihH1DzxxHOa03pxJ0mapTFFRi2CNs2iDTXtg4SaAYEayP/g== 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)(52116014)(376014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qtxgH/jrZ8CbebfWis2y0UyMwgjDgg2qOfkVEeVCoSKby1VkPq4vAI19YaHjgYMasneSMmUPcjXWRhskq/XLCHB8eaw3OmfnFmNtvMYwT1+ebI/TE7e8A90yQrdJvkXQeZr/x4bC8UHZPWYEqJ3FggdpYzmavI2PAkBLGVq19nwYV9fMi+tpIF/tpsZ1FHTsB25f7W7XqAWlq9dfiPgmifV6FD7CFBz//EoqGXEb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voiT/sWS+iAlNXXS4e17n62SORcT9u7xLoxkbJ6BESrRJxTTRaxXmm4CcWua56YudFJWeLestZ4q/t7zGbPWHRsN7jZC9ia/qli2F+oXRCazE638FE4fKut9rcCqbbyliOuDIUyTMulkKjVoWa1pT70vVLYtzAswixzBPVoOLPHyxIYZQJ3n6Nfvl6Mp5NHW0faG70+W4vM1RdQ73nYBytDfBcDe/chieiiMaMQ1RnOieAEfaMj8jx8F7qxwgCH+ntHjrfVBfgMHTKTxR2WyOu852MDfxmc0RuN3rSYwSU X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: abfdcfe3-19dd-4d00-99a0-08dcc8243ffb X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 12:15:20.0022 (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: w4AZQwsSgFF/o8dm1EKNTadHG1AJXTnp6fCCGc7OXvCXPOr9OcJ4UShC2n16YW223So+KZx3HguRlnmmSGOB4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5376 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 12:14:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978409 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=F5Sje2U+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=linux-rtc+bounces-1775-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (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 4WvgHd2y9Cz1yZ9 for ; Thu, 29 Aug 2024 22:16:29 +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 5B53D1C2257A for ; Thu, 29 Aug 2024 12:16:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FAD81A76A4; Thu, 29 Aug 2024 12:15:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="F5Sje2U+" X-Original-To: linux-rtc@vger.kernel.org Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010027.outbound.protection.outlook.com [52.101.128.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A364A1A4B81; Thu, 29 Aug 2024 12:15:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.27 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933730; cv=fail; b=b1AqBX87c0FNsxy/qa41aWy9SL4RPGrZWLX5l36hR2GDSbqHvBTJXms3YoZr9gxC91ckAhlES3Fjni03Z5olGcg84tHQWfBet0/bCAgozqG35NDWkcSBtBLazEDyaSA8Z4hseYeCeK5PT51H8d1wbxIFBi5Rl3prnlWYZpLvfeY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933730; c=relaxed/simple; bh=ANEWUoefTVKXXL8n7BXUbO9XU85GgPMIbI4eoiMkzE4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=KJrMFk68anfLG9tHLCvHMoRtgsOTyoYzE9EOqC1Mpe+VkG9kM8W+va95aeoEmaqWViQU2n8dlAUrRRti9N8yxxpzYD5T/OKmRPH0pDJ4X8bfgRoOSJJJEboK36TstGLBGriVCRD40/EN3GNkJWpixxDo1NVBcltl9GwpquWw9Gg= 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=F5Sje2U+; arc=fail smtp.client-ip=52.101.128.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N+EeV3pJ1XVhrkuWrK29lLJBpos/RgT5Y7aism+z2UIJ1k6r9f018J44MfiHrJdndt7i4xh3kVI1UGKUacVL2giN2a0h+cGef/eLBmQhVY63+P7Lm/6v1Hp13dio+66jd4nWhiT7BKWCWmtv0DkJA5COvRkZrp9UNdSqNUGroS6llHkbibmgg9toB4K6TbAiN7M2VBzoFj8N67Xe5tMpvlkKGFqamuUwXQ6ypPHj4IsM0C4BpKtz04H2bkfY7LzwiSv2LG/dkNNSXx8VB4Eq85zCSEdTyAJAMnvZwCDBHXpSgF8daurz/uQbQxrtjq2NGRGFoRVzZGSkZO1QzNWIzw== 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=Ik6tn68qxh3OBZBtvhX1+kS1vg6s638TzB3GYMbWavTn39+m5wQWj3ja0Sdn4bjvgsxNrt1SB8BT+ZMgyB084LQw/2UK75c0hpJhcpU5bB585C4uEB5d2xq0YNBTEY9tdl3VlmN63fe4yOv5N/r4rfsowypPQJIWTap+38yTVp9D+VMTcFtN82BJXNaPSl3CB6T570AKkk7zpIrSrv5Uj0YEwYPNvc4rAvBhdies/u++k5yg3lT1zU5KyFGif5JcoQlnSOcEIaBe65cQJp3lpnaxpry9a4W4eTzSZAiz1lEWVVWmIiKeGFwW1ysGsszAF0IEh0Fpsl79VmWziHv0xQ== 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=F5Sje2U+1yNPrgOadjrLZtHq1qrMGgUfa3YjJc0gNk3bdMoPARORXWVnH9Lz4nLnIRIGcY7vXngrS3EJYm7UDHQkgW4vLu2QRoggM8ca2gH6CYTpUbxygFOc4JWan2dJ4zvwJvsdSO779aUAX7Cz/cexp2jvz5vNfs5XtLdHe7I/YkS9DvMrTLchrmebD37vxjjBcD/GwHrXC7qxZ+08ePFbFlF9r3zZ2hnroFjxiwWXp7hlAD7RMphtk36pf/U6c7259A6Lf4+HyJr40t0MPZArRflcdFtHYcQtGue+6H8NLWVeB49bvMI0/1jO1CEwS/QtW0KiIImnYAT4wle7rA== 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 SEYPR06MB5376.apcprd06.prod.outlook.com (2603:1096:101:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug 2024 12:15:21 +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 12:15:21 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v3 5/7] rtc:rtc-sa1100:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 20:14:53 +0800 Message-Id: <20240829121455.16854-6-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829121455.16854-1-liaoyuanhong@vivo.com> References: <20240829121455.16854-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYAPR01CA0156.jpnprd01.prod.outlook.com (2603:1096:404:7e::24) 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_|SEYPR06MB5376:EE_ X-MS-Office365-Filtering-Correlation-Id: faddf504-74d2-4682-598b-08dcc82440e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: lN4FmRSlIl6O1nCKI9r2gI3+PXlnAffbkvndkGsxiho7DkeIhVYn83ELtewHPRUoMpZHHL5telIL4FsuCJISGEF23+H6ULm/0Bt4CSQCA4X2lue94ARbYtZYwP105rpHdlZoYSzo9F1iyWRhc7EqD+sPJ30N/9gRFJnNgCdtIxYSLFYUr10y+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gB9RiJN9IgoV6mrJeocxvuI7JA9hQ8TxQP/CE3j8Tbe7hoSc64k+qs518cjxn32f/ZKbzoaCEbp4YePI1B/rxJYfA8roffirERp99GtItMqA0AI9JvmyhV6PnirbHad2kFI05+OqmzsFZdvFAPPBkuvJeD6fw== 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)(52116014)(376014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Bfb3ie72DD4pHacgbKdYbF7mxsSvZpy6vy7dbw3bqUSkC2DL9rdQHtiuP93NtMk6zPMGpMQyqXoaCEr3m/DApDIE57fBcWafIZqnNqL9HMzJHTiusq9yqaWGBqhON3EAYGsxtOBlw8WNJbcumRUppFCvqO7AO/vmKj+Kj202de0IUP1y7Yz8uSN4sNslGj/HK400F1Jk7gMbeQ/VIPSi6EiQsEmodxqUwbDqgfTzS+9EjMUl+ZgXeCOjN/Oa6tJw4pBVMr1RlIiSX/pDla+ysZhhz2rTc3x7egBkkhY4/NMPgvq86C2k3Fgya8UmmDVxyDYcKLIPHVHps2A+8pQyIYGCUeSYp8BvNiCJJ1QikG8+xV49rufyT42see5spkE6DTDLzzqeGmz66WllCDhQ9ARH0gmTyt2M9Lc5ypgZP9+pLC1/GD1d/1q2+z5lUrlGGN8hEy1HcAT6dZUhD9YsC0H61eUmdCl35LWG+39VNHJYKWd6X7VO97/YW/r0es023XFpkbQaTf6u2s9Y2XxkACwbp5D06qRpCx7Qf91DfcWWR2HPJM6CSztk7TY90W9Uprj0GxMRil2HZDcbqLk13A+SDosyvBve4AwSmgJpu3VxfxzwNcb5d5X5z5NXz2XxquxuDbxTgCdxTN2/n7gebtwvpbo8RvQgt4NzC9bTIrZ2RKwKC/U38J7Tzqqgp2MrcSxzXLI3DzhC9+x54oWXNl5uvO0oyHd6tZjDuAySRrat2vYC2UeIlR922HH94Ba6alH65bCeYxKqgVob/nNXU3nXlA05HcZW0sDGT4d6UyWdeAYMjl6T5wwQEUNGEOFcsoytpXEpr6Oebrtuw8xOutYHvqp7RxxguDjubQD4/BaPl9MhFKTQo1eUgUrR+RAme6JVd4QwjZwBCej8d+ueeEphI72lIW3QpTJfhe4Imj2CIDkgRwtYBLVLxVv/vx0UO65GqoKWxUoXICF2AqvNhSRdiiFFzr9la7eCyG7KklpCsYc6xOP1spsH86SK6Rhp55ODxXAX5fDJQFrsTi/YbgBorCTeFohOyDr8/VENFOCMwVb3iqdbc/5L5XNXwKglUrT2NpBJY0Iy2+gNRMqVX/PjdedhTxN/akSKeWOUUh6HHpSmqk5TzfPbKrXmqfBW1t9SQbL/XsIwIdWkeMHsiI467tIst2cxU7uU4lQ+thP+qKkBaHi+KuB/XnRxrbBWiZ9QzVnjkVrq0yqa31db68ZqqVOe4wrp7mf+1VmTuP0gdxV/jNlGt9aCSRWvSkDydyw3/NmH0Y4hVZd0pgEW0tOD0mp/MyLdLZ6oIcHCzi9tWhddG5ZdoDwzq7Nmhn0USrfBPmsDHgzplrKOz/UmfoHK8h7EGwVOyNCE7R4Hfu4HOPVa3XAEkedFHgtDE/vr2g7AGt/pEH/YKczAgxQHtUM0Ot53QlpnUFsDc3Q2YLMzBmOnWk0eom4SjLm4lcH9jOaMoOZOTIoSXQNXK9AYcb5i+2dW3D2RUvhRQdCBiTHJ+Nme+mzRCDc4xCpYFO0dUL7+dsva6ines8RR0yjaz+7+9tfWUb/GSXXgmT7MOe0Fr+uJY6AM1DUiF09aoLev X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: faddf504-74d2-4682-598b-08dcc82440e2 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 12:15:21.4523 (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: 1d8LlDWdV1u3zBJNs5vOcIMicW5vkjapeYAwEcPWKIGwVLGAqNrGowxIau2HM7W/vjs58S2REJJvk5Xu0JKVeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5376 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 12:14:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978410 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=SPcx3IQo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=linux-rtc+bounces-1776-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (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 4WvgHv4nTSz1yZ9 for ; Thu, 29 Aug 2024 22:16:43 +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 D55901C222AD for ; Thu, 29 Aug 2024 12:16:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 46C7F1AB50B; Thu, 29 Aug 2024 12:15:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="SPcx3IQo" X-Original-To: linux-rtc@vger.kernel.org Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010027.outbound.protection.outlook.com [52.101.128.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92D381A76BB; Thu, 29 Aug 2024 12:15:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.27 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933732; cv=fail; b=tUFpfhDy61d4XMvP/SacBtlgsIjEQAbCyfH6Fz0It6UpVkF7vxo6dDfYY5x0Unyhma0AHdsHznEqJOWLn4R/sh2KQv4U6bf3BTEFz4aoLhsyPWuJIxsxcjAHDtNNn2riSQZcluQfDY9uPNZA6wYeADDy0Pjn5tuqSJpgYUbO4j8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933732; c=relaxed/simple; bh=Q3rCL/VOfCnybaX6C1aZjp5ldwRPJZgp77pk58itpN8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HDh4CETc+gMLMT0Kszzr7TWeMgjSGYdjyBN4SrFZUNpKh3EbnPazgqrcBEzcoWrqljaUgQWrXaQ7Uv4D4zCQk6pmDq+PszoNpvnqtQie9UiU/TnZ0qfpyp+mpR4iGcqBIOZ3TstIakmKGKQJe5R5+3/w4GYdLQ9I+z/pJJKXfME= 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=SPcx3IQo; arc=fail smtp.client-ip=52.101.128.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e/hhRutB7ZZd4yOtgwyMSopRKzzUICfQtIYUgxAHvHHQKTDZCB/ltIcfccqFyLFAwG8Gz3JO+fJN0gWT3pa9jmG3KH4dIdiDKb4J0VOiUF2fJv0p70tkwNVMAMLLPP0KncqDa+l6lNGzuYp5s8ZjYWHn90jLy0Ycdf7Und5eI1MrxfgV4fnMzfHAp3OVmQUqdVG/ubz0y0Jn3Ku+3FieaC+SOC1iVe8g1KoPRjrd/+ZAwOeIF+L7pVR8WiHKitjt/t4JZ8VT4z88GM1d7lrFhc+nUcqoBgrZRnCvASAD7V7MgKQvm2HD96tLsHwH/V5w7bdCKwNssBO20SY1MW/L8w== 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=YDdZ96n9S4BhUzKoT1ug0mx8Go3eKBJuxhR7amLm8OmaJaHUAouyfYRueCWbCZYSBEsGezBz21pOYT9wBrs6e45rLe0YIozXUy0A/QduSvw4JhKi9lvK+D97GxstHErVIcuh6Qpr3VHx+Ziax3YizD01/SD4cM/JIobZQ1cnmTtGnU79ntQEOyWXVGyzPNdYJ/YDLPPdzLDUsI1CWLrYf9Bf3nTgs/A3pNRSgaCfH7cK/c7w7BPeuEgTkgwHjnS7QI+GIiHjS9A8hyfk5smD0m2xNANkedwa2k6TaARgnqk13CEqF8AMuFViC9IYAZ63+RigYBGdaplbEx3ScWK+3g== 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=SPcx3IQoP5c07OMs++nRbfwWPb/yscaKwPGuIkHBizv0FZoqpFzn3SY1vX6y6i4+t33ZmS9ouQKsdVUsSOPPwJapjRJfhdhn6bwUAfBHTEOTpGwdDV3y61vLQD6yV5vEoC/f61jExNppPSyzXD+cd4fOetr02WW2MqN8jMhbXTb7f+lbc4yqli5uWq6DBt8X3IVVVr5tcJDEykWx9QS8xbasxer2hpS0wsMGRzjpXa66r/GnRsy8VN4ITj+edbvor4haAWlVlEmtTviCRfiA6ti5UQUnLHGNyF4+8czslUAzsR+5VzS/KLv1Yle2brEXXX8WbSmWJFVT+5eC5T1N3Q== 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 SEYPR06MB5376.apcprd06.prod.outlook.com (2603:1096:101:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug 2024 12:15:22 +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 12:15:22 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v3 6/7] rtc:rtc-tegra:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 20:14:54 +0800 Message-Id: <20240829121455.16854-7-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829121455.16854-1-liaoyuanhong@vivo.com> References: <20240829121455.16854-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYAPR01CA0156.jpnprd01.prod.outlook.com (2603:1096:404:7e::24) 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_|SEYPR06MB5376:EE_ X-MS-Office365-Filtering-Correlation-Id: d2f614bb-7799-467e-8ca4-08dcc8244194 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: bek2DsOPUGZVqCPJtvsheIAf/19ifyV0du6zC9gVOBAPEfiY9NXEzaQfhTeJQxDElxOvHhPgKnsbGV+5smDaBuYt3zEW0z36O/3aqpZMDiaVM97wi4ogqCwCmiUZqP/luK19cfxgdpfJDZ66q1uG23w+kZ37U8Dmumsrdr1DbHUQYvqeFZHV8Sh+BO+UD4Ha+AxZcaXWDXzCxQqrrDnq3xIfsXNAj9rfeRq8y9Y0OQJUxN3FtDzI5EOCzl6rubiou5Dw0UslYMbTOmo/+6aI9pv0GS96LIx03Oj9s5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VV/aGr+JNvcz4sk03/DmKIhxn6NfPY/lRV3fvBpYRXT93Z5+86Q== 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)(52116014)(376014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: p7IC2HHc8P9Bn14purFoxiqQosYSTI+zOshyf5Mfwm9ZPvO79D1ykTatXL6AWHkHw7ZUZMKSMTjeDBSsW4/fX/h5jaem1BKCnPbxbPi1ZjsNjHHM0artlMW7DweDl1VEp98ANqdpjdX947s35jsvQq2bgS45Wrh0WzF/Xme6o6X8BuIrpzPTwPtDhKn152RfaJaR09k/fydx83fOONyeM9Y7GrIVdkOtes4x5dNNmwDVMKxFg88MiRBlS7hOtnYBuMBcz4ao8nXOZ/zOzOPf221jMdsDBX+o279vmJa2bZb1/BJ6DZdnTdfWRCQzRa/+kPPY+HyigQ48yOrmb4jZImvyfo1zH/w9cnmhDBtnLvd9cx6AzRLLFDwMn57bKaDuWe2bPavB1NyWGj+EfHF6M7OBChCByqFr5Jj20MqwCaNFv6+bkFK20doF4l77vOSEtgwM6N0BybuJypbNbQs8yPIo9zFBibm0b29nStkMng2cV3gWna91KzRsPniKJw6wsEEgMN4iOm2AVcBtvTR4RfChz8I/eccJe7ZB1muYCTSv9dqZPlHqSHoHoaotWE/SR9/tnVtVaowszCOwbDruHbS+I/hXg9ZQ+5vaCpMXuBAezPCYX4XBHoUwTg2Eq7O2JhNiUk+hlgm5t3vPZnJLOw1XqqIXTffDNSgX4btM695QlTUU6icUhABgv7crhsDkx2HK0leQaGjpU5JiyKDdceDrkVjIo1XQGbJKGpwuS7mO1D6MwcYSORo0Lq/d44nfZeFPzFQE6XmgGhTe/wY35VLjzlF1lDwD3HQKrAVg2pAzXVIG+WEgpP/KiX2Q+1cGpWI0hOzjUeje3IBY4RQtva/PC7PZWN8aMo0xPudHma+kNYQY3/mJwp8JrR5L70p85SIRecNW1jC4dQIyXAoMaXYXH+nhpw3Iydzcu9k4qnT0+Y5K8wNhynAGxjfsLMocnt11Fx+pHdE9Ry9ZVQLRRjjhBihLP20UztAccmOeoa3PHiz4a196PQgGDoURAC1jVO8yUzxCjOuyblqU6nbUbyNZiKJuCYdIffjUVQCqkIWoiEjtj/PGpR+apd7iAGzCKr9o52S5oln33wHKUVfSN2eQwyIzyRVdHN83Y+s5TU1NXCkqmXm1vCqSTsF3pIL/F7bAmiqs/k8oWQpIBSEoAdFnCj6NbaQjdCgadcAePO77bi8aXprKabD50/p0KwH3htjT2Tbora1F5s7EyskTmq8zz6pR7aZZNmglp5bU73f9daHRRIc1YwMlFRIOVYNkwyJ9pweIgbi7tAgALLDG1XtstgQ76FMQgAeUuk/n/zguX2mskBryEu2fSUUH315HGkJNsw5uHj8bJROHhHNUplizljrpKLfwotCxjvSBIceIg6nVEAABteWxHH2/0d0JrvBO4zIu7jiTD4lECrFwW2ag5osLGgHb8wYmQ0yN2qXsbzaaxl/wwXQ+SE/xLJTIeiinR3txGg3hlhx3vsSrK7zQ3GnUViMLSeebYLYClA1FvUErYQ60CXH3TV2hIjaPQh5UlqBzkXmdEk+zVBofbLc1H97/0oM1TrGdoasQ+40ooF4kzHqizeNtPIfl6gHy X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2f614bb-7799-467e-8ca4-08dcc8244194 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 12:15:22.6079 (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: kdyK0RaAn06FFSRS+SdNHZeKEP4qUYdKEqz7roYmLFMMAQkfyzf4u18+OuTyRr7Zm6RyLGxmQm0PlsfouLincA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5376 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 12:14:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 1978411 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=NLNVblNR; 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-1777-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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WvgJ861g0z1yZ9 for ; Thu, 29 Aug 2024 22:16:56 +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 6B7CBB263D2 for ; Thu, 29 Aug 2024 12:16:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 30C361ABED8; Thu, 29 Aug 2024 12:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="NLNVblNR" X-Original-To: linux-rtc@vger.kernel.org Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010027.outbound.protection.outlook.com [52.101.128.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 800C11AB51F; Thu, 29 Aug 2024 12:15:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.27 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933734; cv=fail; b=aZze3cm1RCFN2WIht2U4V28Cds8ZKCuLI0zLuhqThVvTVSnc42I2BsuzftuJM/cpT8L8qyws2AKMmTLm5GPpWPx13xjPKjREjFQSXA3B+hlL3BQkrnkQO9unAdXWBijVhUDho8cAwvVIKYT9PrWJnGVGFeq9lvyoBvAjocNm0EA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724933734; c=relaxed/simple; bh=Rh7fg2fys7ro4frD076aYNZDOCJc+eW8AmAacWUrzvM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=AebO4wC3c9WyCSlIN8d7awDcswpWY3zM+Oepa8xMwvAmGTLePZCzwuLWaxOYAD+rnfN23ISLdXcUKKqhOU3U0HUKa63dPC4oBbf7uq0lYk77LlJz96em+qkrYqlD/szZrYsQQx+e2LeUrnJDT7/R0JEZIBXe9tX8lxcTbhTXaUE= 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=NLNVblNR; arc=fail smtp.client-ip=52.101.128.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mq+QldF/M7q0MUkOiNyxFYN2ub88lYtlKkrDv1+nJRObb7EjJO4ET42bYOkcMgx1Je8/K4j3q6t+/mt+BaHsleyRUhb0yGqEBJSXJgDU3BBR6sMw6lGDayX3VONmnbuAoAIW0aceDok+dMQD5nTKhiWdUH78gTHCVQcI4ODR934Pn+1ikunAynjao4NLGeqdOGwR4PwY6ddfmQetDxSGQzrdnOqrSYGOItyXQ5kzO88GEXyz2eAVRyy8gpTrpAR3n1JlKVuTL1qBeiEDcClD9Nr2baw4uSk5Ugo4TlB+CR7IPMvIuGWGuikhkpeJlWfXoUJe2vtwmkkTAGb4E5aXhw== 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=x0dVaVadPtklIGYcqUIiT+utjE4NmcO21xn18/2s0+M=; b=XFTNBEMMVL/1KSd/KMj3A2Deh2QTlOeSUWE6sgu9yeO7277XxMhMQYcs4VyYs7Z8RRqZe7E0ovXuZ8SOOgxfeOIfR1s8cRTIiRpJ+k7HG6uud3DOSQNbnTuPxh+WVE75Mt4nB6wy3Gf4PXviiq/6vohRPlXWSwSZN64ik9mTOtZpSV0+7evDJ4RT0WQDCxJEGm4Vc1YJxfeFqoqDM3dbaLpgdtMtQgV0q6PXJssZl5GwX3Uy1v66s6P0Ls1u3IhHrX6DDCAd6cVQhROjBVj0Fc9QSient0vokF0lUS2qd4J+EwVkF+cbMrNGwwL3uxvzMaQjZvkv7+wqp1E8xcZ4/Q== 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=x0dVaVadPtklIGYcqUIiT+utjE4NmcO21xn18/2s0+M=; b=NLNVblNR+uTs2fx9kq/HxHQgPPRvK4kYzKvX6gr0jcJV5KvHLsAD68zNhxvBjqg1VISK3+13MajhYjt+ST90ABV65bSP9aEIjWN+P6QszXzb5aihwZbRFiejUbm0eznoKs6hYGHH5xLqcAdVk+kY55w4mxFNj1VrKfYQcC+oUaV27FEkAonV5GtrehzMenWbLA1p/bmd6aJkdsImzH/20lwbi/NzARy9SMYQEi/PumgR9I03eSmWUik6Vkyxh+tGJWmdETweQm4WQIkZM/04eZN1OCfpOCJPTlWqSqbnptwrwHA54k0cLDpq/qSDh+CTXP/AWBRVosPRLA2or+1eiA== 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 SEYPR06MB5376.apcprd06.prod.outlook.com (2603:1096:101:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug 2024 12:15:26 +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 12:15:26 +0000 From: Liao Yuanhong To: alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH v3 7/7] rtc:rtc-xgene:Use devm_clk_get_enabled() helpers Date: Thu, 29 Aug 2024 20:14:55 +0800 Message-Id: <20240829121455.16854-8-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240829121455.16854-1-liaoyuanhong@vivo.com> References: <20240829121455.16854-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYAPR01CA0156.jpnprd01.prod.outlook.com (2603:1096:404:7e::24) 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_|SEYPR06MB5376:EE_ X-MS-Office365-Filtering-Correlation-Id: bb1fe641-675b-457f-c669-08dcc82443d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: S6lrsp5Cnw1DUo/NPNzMQIPuB/vHH3H59/Xn2BFMFeny6vMNO4YLZcBK8l4QijrmS24PqrY6KDjOkAABRLaa86EOezP0W2JmOG12PRnyOIB1SAUEda3QFoF8Mg1UrgVKUs602UwcJ1Ig8MIa4T51Gt9PWyXo0BC8cYhcAJlLNjC8P2okrVT7zuJbfnafbdnfBTJIIYCOgx5Nw2a7hV/Bk+VvLlbO8k0S7xFyimuumcBFOsfu1FL0j1C8Vm6awJA2MaGouB8nW5ZHEP5/1FiqSroLjpfkfo9HCM2CnQ6QdyMUV5/HP0P/mNTHxpdG5bkxni5tuu9YB2qmwAuhdLJc7irzdlV20gU+K8BmmRSDksvvAT14yHOaJ/7n1sahPi92LDfN5gRRt3ZWQN690a4gbLu7X7M+MqKzWfZ0to0ntJcSkPH7VsYH9DKdT+s5IYQIYVHywDQUcGyYMxMaNJ5NrLPK5+9O0i4s11aqVOov3jp3t7pqpVjMYzA1e7TnqGrTmBJiX9O3uAvzynagR6EK4z32FM8Jvrw1WQg6Sm0eRvfxS/V5uhiwGSU7EJXKZSR0JHTu6bOi1vUWe5w6S6HMHfrIdbf4TiDJRX3dtHFonZ1vqcPRAinTepOetpXqh4klk1IHPrpW4660wvtjBL16VrWsCQdYoVMJCJCL37cOtyAt/BBDBsuqtlp/nqI/pRkEwIEry1H8XXC01ay8iYytx7GMBAtN90aGq0q4/ytG0wQFXLo/RF1jfj6BZlZrZ4T2u/1o6k5n4zYUQ1zXvUpBjKGUkIFxohIAHfLMRC2RnB4d9Gw3RrCVWI+Ty9m05+erD99p8KlmwfFPmyVyXHWYBjS8NP61JHchhb84yaR3I8hJ3iw6U4OQzIQE26AAraHdp2tNwuOULArSLdEGXl6mfJJOKErIY5K5CuJOVhs6wvoVaMIHks3T3ADi0Ur+KGiPJElyXf9CGn5od/+BiCNoWFds5uywQN3yv6z93fddZR2D2GJC4B5ZEzq7Lnyn8dxeElJncGql9hIIfp6xa6WoPyj82dJvaxmMc7zNDiZxNKzxNHEmtBNNBjFacKdwXzaDKXJfNVKNp1AZaNvEDAIN5RTPri4jWgxS5bznQKnFDknniBO2UgLOqmZ6u7ZEQvz6Q+6rXyApgPbQWD4zMTP1MKpRNQv5/SQHIL5jMrWJe+O7BcB64f908JI49UJBs/xy0lxVKKDO8C42ZapzZ7cdHFtHx83Y729eAaoeEgHt8/iNrxEhxdlAjEaQcqe1g/bUqFRKNkOvUjuDF5/PJlieIhTO86NZk32GPI+piDVb0c4R3cDOkxUx494KVL43s+LDoV1XkUnR0ffPkTVw9Zkd8oSuuBxxEvrBcHRW7WPlhKsLaEU+4Jvya+TGQAWbJ025Mp42VRWNcqfA7XrjrskcYQ== 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)(52116014)(376014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Gvw4o8j1xKLdQBbcNNj9o+lm1CNGpg9L5JVGe2oclCVcpR0qMZmKiRV4ns9FPCkQ3WbMnIEAwNfetZij38sNPX2EGpoz8ctB9NVjA3O0sVwbUA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rSmPbp0FiqN2gp2/0T8Rpfew+x2+kSv2xpGVHpn/kOIR1ULorvZ4vfxAWZd1gY3WmrSbMJubx7032Iuigii0Td7oyr4IrKn1WZoAxqkLKOgGyFK2nuo5kqZBkgAFqIJMSYjwgYS5FLh4pB+3QfMnG9t47DCIOPafwTIH9jFFSimd6igAyKHVgye1vg/Ve79vAegW0DYOQK+qUy3M0zDKJGghPHqUjl3nWeyxjAc9SIcbd2F/7I3KCkwJp2EvTMSCe/gNHQMy7WplofeSGNhczqhdfFoShUdPB4pqzydLv2LRJ4GXWhXb+20bzx4I1Gyb4//gIhby9zmpAOAT8vWBuBXaC5sTlWBiANSPvl9Kl9Q48uERb/pihEoJVg41yAJPQGboa1+VcwQD/VcybbkEx4zlAv4y X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb1fe641-675b-457f-c669-08dcc82443d5 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 12:15:26.3992 (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: +u8lQd037kN03w/OZIZwpxJiQAbe8+VYZCbIBO0L/h7Pfh12/3CU72A6kdiQxsK8vLmDy4rEzzqJtStgYFGA/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5376 Use devm_clk_get_enabled() instead of clk functions in rtc-xgene. Signed-off-by: Liao Yuanhong --- v3:Removed erroneous modifications to the resume function. --- drivers/rtc/rtc-xgene.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/rtc/rtc-xgene.c b/drivers/rtc/rtc-xgene.c index f78efc9760c0..fcdb349b7399 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; }