Message ID | 20240826113317.7342-1-liulei.rjpt@vivo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22BACC5321D for <linux-arm-kernel@archiver.kernel.org>; Mon, 26 Aug 2024 11:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z5F4Z5JDNEo2PMJrYJBGtWIRDfs1Ke+lcfNrt8WbmNc=; b=s72r1qBSqeYWqY5jszpe9LgOC6 Lqh0RD1iSdKtALG2OdZvol4ujEyB+yFu287w/xwWoZn/sc2lFA1t+5DTHp9dAE38Y/5+Y5xEdYTzc 7kNlm13t4AY9Zn6C0wo+nBqThDq+fNvNPNw842UuZg7HyXWs9IpOM9Ugd/hz8Up9xci3ZnjPPrjJL RDxrgKITn3YW8ZZqkpyvz6UdkJ5n4QUC8paQdnWHjRs+y+BbnxPY9ojvft900CPGwfE9rbuXfRI4/ mlIscjed6AoJVRG/Qqz06vzSmA4iOH9fTYkyiNXGFiY4CE4ndRqiYO7w2XQvf6G8A20sk2NyW5o0F 1KXFs3SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siXzt-000000079qq-2Rhu; Mon, 26 Aug 2024 11:34:57 +0000 Received: from mail-tyzapc01on20607.outbound.protection.outlook.com ([2a01:111:f403:2011::607] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siXyd-000000079em-274g; Mon, 26 Aug 2024 11:33:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EIu11gDjliBrNvtbQGZ/SbIVa+PEK46joxgrj+aCvMIbHyJBGuGTgWXCIIPDxRUaKPdDn3LYybNS+yglIGAffXrpyJxmxmqDf4i8t7FcWlI+oJjUXCT8W0im3eaqPnx+1E6BVnBt8i2SAF/OshgbAYOUeSLXuu1LhhokLQoIxw/sfYcp070RROzFzVED7sjIL+u0HWxEiR6OlUPmrAvAKobsJm0dz/JVRU/C4rcbeqCrQtTClN2vtoHK2SSG0CXVF3uT0lfNckY4moEIMXtQlGvNXfSLt2Cfj7a1SVgrS/8eZSSCFPQXcg7zwEdoRIIbNjo2QZ1ze0hqCuMW7EiHGg== 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=Z5F4Z5JDNEo2PMJrYJBGtWIRDfs1Ke+lcfNrt8WbmNc=; b=vRdzopIBRKh8DCu/iciQtj9Cb8NDeBOQsMEZYf6xmlWk5IOrHEkycWqWqXUuTPOiUwm6KvxhgZzHst9OjBgALpcpr1UAzgjy9BLN7TNc2s6P1a7ZX+HaXDOdL7eUxlCu7zJ0WvGt5jn8NlyLffV/vbN3PejlD8zr2c7gz6T1MVmRVpFBRo25R91mc8wkyCacgQwTWs5SOnb75gLHCKuur5XzY4Dx0Ag3BxQV8x7KrEl+BqJTZrOUnPdTDNFNzoPysng9rBZmbAnm9Pk1ZaBQWoIRIAz2R4hD0emKHZy5ReElRTPp3dsn2kO5gXbXLXAq4+O6oxJIvur3pts32KO4/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=Z5F4Z5JDNEo2PMJrYJBGtWIRDfs1Ke+lcfNrt8WbmNc=; b=j+Oim4jcWvvFu1JPuIKj1DKAN9OECfchXhzeAF7z0YnDgm4yIX37H6Mz2GprHPoDykvNkEWnBERGgZ3CD5gzRYD25o/C21yYX9HqWePcL9xmc54tmaKa7Pl9VPuB9n9vnMSSDnG7HbVec0ysVzRvKsCTuRN24GzPqUTEAv7+SMnvW3t5cnVWyujzhFT4e3TZ9t4SXfLnVF3QuGIc+HkVgF0A8mTlvHPvqvkBRCDwDzcVGoI8MaycTac0504vz1Ym/VpBQ3j1JnHfbrnQ+EdnRIbttLIBrMFsSHjut0iVhAEp+fZ83LQpvmW8LkG8/gMs92qF4rLgYbtvZvpfYbrKhA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) by TYZPR06MB6466.apcprd06.prod.outlook.com (2603:1096:400:45d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Mon, 26 Aug 2024 11:33:29 +0000 Received: from SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd]) by SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd%5]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 11:33:29 +0000 From: Lei Liu <liulei.rjpt@vivo.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, =?utf-8?q?Andreas_F=C3=A4rber?= <afaerber@suse.de>, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Lei Liu <liulei.rjpt@vivo.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, Jeff Johnson <quic_jjohnson@quicinc.com>, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org Cc: opensource.kernel@vivo.com Subject: [PATCH v2 4/5] tty: owl-uart: Use devm_clk_get_enabled() helpers Date: Mon, 26 Aug 2024 19:33:14 +0800 Message-Id: <20240826113317.7342-1-liulei.rjpt@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826112933.7249-1-liulei.rjpt@vivo.com> References: <20240826112933.7249-1-liulei.rjpt@vivo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0026.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::13) To SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5624:EE_|TYZPR06MB6466:EE_ X-MS-Office365-Filtering-Correlation-Id: 4bd6da83-8b19-46da-3715-08dcc5c2e8a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: Kp/lhTrH5e8Kq5+ieV3brmzfZXlxx9aVf4Z/4h8ZrbkhfiLXiHxMK+Msc8nSV7G5BEemAwkef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I/tkh5SxqpbP8p3lHEpv6gSbujZB7q5xiUQ4Lm1eVBQdf+kUhQhrdd3wLebZCOLMBi2jHMgNFR+K1+L/bXgh1p33z1D4OLn0RMlpllWOSfAZSv04ITrbXGONVXibY2TAhRc7mud9BOmHDsCV7pTbkPyijua0GS39wz/0vtJ4f8kLj66P9wtLepfd6fbwXPSQhiY2YTfSvgh4g1aJIZIZDDUcjMef9aTYCdlcC04342v/0zgNf38grshUBEB4qH36JyqooskXBRJH9Xid0h4OiCzueajQCr0bsdnlMLFQ7ce4GA3U= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5624.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ou++PQQU7cZhsMi5wZwTm+g5umsn3izeMGoQevrZhkm+BsfD4axP3mjJuZDt3cO36+MPSXH+O9EQd9rITdXejiN3fbWkp/P55nqFotQZzaa0jbR+oGfP/zRPWxyb3rWXGTR3rutWSy2TLjQz+7pMTwUU0wgrEF7gYaUOcDbVflwz0fannvel4sa6OUBy5U634QuHBtyg0Lag8+RmbxnH/pdiEROK5GWfVftvFy9htNsVF879ODWotgFSm+FBuzqWqxcZmnjna93O1fsEN5ulqXTqqVKrzbS7Z+ZvyTQtRYnaMK2yCn/cGLkrdZTgi3l5u2LtYFZND5OUWbvUIMpbN6Ui3F8jPpw7OPAzJCUWH9zaTzLmyOcPx3xM1ZPgXWRmnxK+guT7PxppKwYGYHYF5pDug4ffNec6mIwtQnogGnl5DNYrXQ4y8tKLCtzzUzyGezgShGl4GLl0yf96Wrs6VsFmSI4RlfqAJc7DmVsS4l9EfLDAEsTLD6b8p5a9aipx3A3HZZCuKxunb90eJH+KcwYtAmO18B5sQp8FR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id: 4bd6da83-8b19-46da-3715-08dcc5c2e8a6 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5624.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 11:33:29.8980 (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: IRa74sd6vrSWIpkCXS/lEh1OMoSnIYDaaJDv/S+zM/2W7rfUaxCfuBIYIhP2N67pcTmuOxCkSVSFHLteDCU1kA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6466 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_043339_565080_34184C86 X-CRM114-Status: GOOD ( 13.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
tty/serial drivers use devm_clk_get_enabled() helpers
|
expand
|
diff --git a/drivers/tty/serial/owl-uart.c b/drivers/tty/serial/owl-uart.c index ecec483d4d59..28c33cea6b41 100644 --- a/drivers/tty/serial/owl-uart.c +++ b/drivers/tty/serial/owl-uart.c @@ -680,18 +680,12 @@ static int owl_uart_probe(struct platform_device *pdev) if (!owl_port) return -ENOMEM; - owl_port->clk = devm_clk_get(&pdev->dev, NULL); + owl_port->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(owl_port->clk)) { dev_err(&pdev->dev, "could not get clk\n"); return PTR_ERR(owl_port->clk); } - ret = clk_prepare_enable(owl_port->clk); - if (ret) { - dev_err(&pdev->dev, "could not enable clk\n"); - return ret; - } - owl_port->port.dev = &pdev->dev; owl_port->port.line = pdev->id; owl_port->port.type = PORT_OWL; @@ -701,7 +695,6 @@ static int owl_uart_probe(struct platform_device *pdev) owl_port->port.uartclk = clk_get_rate(owl_port->clk); if (owl_port->port.uartclk == 0) { dev_err(&pdev->dev, "clock rate is zero\n"); - clk_disable_unprepare(owl_port->clk); return -EINVAL; } owl_port->port.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_LOW_LATENCY; @@ -725,7 +718,6 @@ static void owl_uart_remove(struct platform_device *pdev) uart_remove_one_port(&owl_uart_driver, &owl_port->port); owl_uart_ports[pdev->id] = NULL; - clk_disable_unprepare(owl_port->clk); } static struct platform_driver owl_uart_platform_driver = {
The devm_clk_get_enabled() helpers: - call devm_clk_get() - call clk_prepare_enable() and register what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids calls to clk_disable_unprepare(). --- v1->V2 no changes Signed-off-by: Lei Liu <liulei.rjpt@vivo.com> --- drivers/tty/serial/owl-uart.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)