Message ID | 20240822033924.32397-4-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 BCD22C52D7C for <linux-arm-kernel@archiver.kernel.org>; Thu, 22 Aug 2024 03:43:05 +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=yFZLkl2G+2rwqoEAfBe7yjbpU8Ts4HtAr8hXYv56EuE=; b=UFOCV0HEQu+4yXwpll0b6KK75Q Gym+anLWNukOoPkME+hLNRPT10YyPYXcBnGSh+S4URaT/rFZXxOpaoowgOjat5w3SDWWb1VEe1p0d 1x9uG3f36F0QMYc5HZjA5SZp5f7qV0mEHdBq4sgl4k7q915M7dcBs6UrCmrdJqzKn5LoPVa/KbY8n OOvHucRQDV8fCB25NPrk+OkLRNGgRJj/9YVIKIQpsZaGs1cYImLXiGCxyhoOonDg65vUIFiPcUwQ6 v0t5raflznRtSJYtaKyCYbEzVvSJqnbqUsCLITdf66dFzdJ7jRCsH+ehmZFB3f9h2z6WKsm9eOK59 tu37xnzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgyir-0000000BFjF-1qrQ; Thu, 22 Aug 2024 03:42:53 +0000 Received: from mail-sgaapc01on2062a.outbound.protection.outlook.com ([2a01:111:f400:feab::62a] helo=APC01-SG2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgygj-0000000BF1W-1Qcy; Thu, 22 Aug 2024 03:40:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kPtHFRAwr39B5oZgDtRPo06eilLVw4SX7d/atzwo9WyWyW9IqESuK5dIvfy/LsX4okhbGHN6+YZgJkG4z6F1hacQJSDiUnYMfDXnh2A8v5tQF9YGv+/egXCwUemnPcaX7Ri5Wh7mCUAJ4ieRpssoN+a2CVHCeNGYcw/brTULkfzaGAN0y/ScOgdNsgO2jncvVsgHJK12rM1z5CyGzPXuDFvJPOZA9RYuBF2fnh8EmZO6ZwJLtBpz9oc7kjj4luXciMHIVgSMtQmQUe930L2bkUyd3ykN08Lph7rQq8RHNlD5CgP4J3i1HEPjs7wtKGeIacq93d8SAlVrW3NaJVFVwA== 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=yFZLkl2G+2rwqoEAfBe7yjbpU8Ts4HtAr8hXYv56EuE=; b=L17sVS9Evg95XbDmb/EONaNFucXCWcHc+tJ+r8S+fePleefLHQSfhIZ95JpOHDgfFdW4s6YnJfpDMQLEcEwi1N72ezts2T5ai9LFPS9mSib63PDvWGFtLamancMIyCInL0YADNLkazaVxSA4mbl9D1UJgnVUweQHOLHjgM4FadOy9ReITuIcKljUYh87RVkeaLXhXt4nnWyw6uU+cZiYI2oThaQstMeo3kMYuQyHmtno0AWMOKcUpww7eydR+axeYQancuR2yTz6PnB80QfJe2AnjxInJAsDB5DsqcSaQvqq9GUuIBDTKGX2QOKwwSKmDLaTVi4IIuEdlbfoOrnB1Q== 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=yFZLkl2G+2rwqoEAfBe7yjbpU8Ts4HtAr8hXYv56EuE=; b=beo/RBYVkh4WPIXTw9HpBdLP1A9vl0CzyfHwrae7sXk+b/v5PX9QZ7qwanO6ByLDBZVQi7uVcBQcBxQeqgpVwYkfrwnRNKXGCLuapwH6KXucQ1A78HYLnI4qxD7Wqx2BzkduTOtGpl0aaWr7wzlJWE5uNG2hOqvqiyu13Yu+hXGFVZ6Xhf/dwqG58syvOS/XqBdc90oh2MQGyjNHO34iT30t6+zEp44HQFK1Ai5pOW0nohp9iSIkIs1Sm19zz2nyOfo5P2e3dpbcuKQp3jAAbM7V16eQwuVlevHPgKG84sEoBCt7c7B4sYe5MjoB/Nbgu9DMgK6zF5MZMr2o7tcWDg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from PUZPR06MB5620.apcprd06.prod.outlook.com (2603:1096:301:ee::9) by TYZPR06MB6565.apcprd06.prod.outlook.com (2603:1096:400:452::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Thu, 22 Aug 2024 03:40:32 +0000 Received: from PUZPR06MB5620.apcprd06.prod.outlook.com ([fe80::b771:8e9f:2fb:ee83]) by PUZPR06MB5620.apcprd06.prod.outlook.com ([fe80::b771:8e9f:2fb:ee83%7]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 03:40:32 +0000 From: Lei Liu <liulei.rjpt@vivo.com> To: Paul Cercueil <paul@crapouillou.net>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, Thierry Reding <thierry.reding@gmail.com>, Jonathan Hunter <jonathanh@nvidia.com>, Kunihiko Hayashi <hayashi.kunihiko@socionext.com>, Masami Hiramatsu <mhiramat@kernel.org>, Richard Genoud <richard.genoud@bootlin.com>, Nicolas Ferre <nicolas.ferre@microchip.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@tuxon.dev>, Liviu Dudau <liviu.dudau@arm.com>, Sudeep Holla <sudeep.holla@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Andreas_F=C3=A4rber?= <afaerber@suse.de>, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, Patrice Chotard <patrice.chotard@foss.st.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Andi Shyti <andi.shyti@linux.intel.com>, Florian Fainelli <florian.fainelli@broadcom.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Lei Liu <liulei.rjpt@vivo.com>, Thomas Gleixner <tglx@linutronix.de>, John Ogness <john.ogness@linutronix.de>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, Jeff Johnson <quic_jjohnson@quicinc.com>, Valentin Caron <valentin.caron@foss.st.com>, Lino Sanfilippo <l.sanfilippo@kunbus.com>, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Cc: opensource.kernel@vivo.com Subject: [PATCH 3/8] tty: 8250_uniphier: Use devm_clk_get_enabled() helpers Date: Thu, 22 Aug 2024 11:39:07 +0800 Message-Id: <20240822033924.32397-4-liulei.rjpt@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822033924.32397-1-liulei.rjpt@vivo.com> References: <20240822033924.32397-1-liulei.rjpt@vivo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYAPR01CA0108.jpnprd01.prod.outlook.com (2603:1096:404:2a::24) To PUZPR06MB5620.apcprd06.prod.outlook.com (2603:1096:301:ee::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PUZPR06MB5620:EE_|TYZPR06MB6565:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ea68a87-5e89-4b5c-e9d8-08dcc25c2cc7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|7416014|376014|921020|38350700014; X-Microsoft-Antispam-Message-Info: oZcpsSCMLrNPa4++5BH7nnGidGDjds3r1LeQwSgMxjxfYSEwDfdKUNWMZeDYFdD1uDgGSz8DTq1Ylpf99wOA49JV14qlNTwjZ08QvAVNcua8Eknr2u5ZEsrwmGB0UQlDoVPO2WwLphNJDyY7MioZbSlwDPHS3gI1fTvE0y/eWOmeXouumZkiV5hPJspbpX7eoIKigvE1/d2t2fni+fc2sOTu2xkjllUEfpArHpZTTsVJgF3uGMasXWr3qni4wwqoGYZ8NTQ0GEBB2ir8Fa59uBEzu7qwgVxIfC80wYI5adbbVU/16npcVrhI7ZaWt6w+RjyF7VP4G+ozfiTASLno5Qg5ewOyyEQGMR+jnFqfb+DxB9op2uPws9UQI/4+Dh2Zvbmd7ND1SyRXJNI+17B/odCbh9zSDWHmwP+ta2nYZWjX1+SayKaZZgIEZRlPlkes5o5lad//AsNXpCxv5xTqzcQXGkEI0D2ds2F56iJiJ1g9dLM9TvoZPNBN3Ahul6TZ4jAhV1dUUR/ltiXrTUhtTQgdGsh1VkKGUjZfdz/PaLeEALqMjHGOtnfPeQVpPlFoJaJbohbz9294URRBH8LDOSnj16W5Clpyt/Fe7ED9wIF1UBvkDDS1x76CqeMdQR6sgzmwa7vgVUL4ZRshXRxp6elPkhrbvq0wekRjD2EP/+jHzuRWp8W3yQ5QGQWiYal7xdCoqnwh4VFJZElJgUVO9d++kHRpALMaJ9HZqN7Ew3RUAJN3hpnUAKtHjNzJ6Ehqqv9NRYJBqKamS8NIutKACq3y0WtXSkAmXIR5Y5aLplqMccdX0WTaSSFqNXWIBGKiKKAoS8v4ZaPL5pa+SGzMiq88l0KmY18aPZL5VFil2ai/WUFvA0b9EKBRapbdg0Za6GyrYKzEzDSWbB1Gd1KRPbxlu7f0Y4A54l0zeRUGE55gMcI5OmECxByjC2FC1FM/zTntgQ3qr1b75zy+h6gyzy10PynmL2CiakczaAj8TktS2zefn/+of+HUCjl/vKd+1Pgo6+Crx6Y/xKWxxkE1cD/jqEZmSu05xkyeYJxDbUbv5vLVKjZ1a/w0pw4F8JnY182x3+C2A48RwuND74jkaXyOaqkSVIeEnF8XqmLiqk9X9XrjgNgyN2hAC1ZBMOLwJwVkFomb51aJs/vtlDiKfvP49HC7diQHe2GMMLL0XkV/x29JrFmLjQS1br2aEs+jqTT/ex5NNeaajR4I1UcH2ctczWuxjzTzbvsRwVXwlBw9QCYJQgVa0DjM8PLHsHXACQmwptJfkrmooLX4RkGxGcQf8QlVwkoj/vCnMxeL7VWddqy8YI59Wr2MbfjpX7mIKiKkul3vAuHg+QIuChnSVGL44IIjj4mpvaiztSFb/AeeUSSYh6yR12DWMrfKku4Am72LCnXtGps6XiPpZO/7NXpjfYYNXIH1YPFs3fqWqXw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR06MB5620.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(7416014)(376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jM14czCN7PBX9TDQcnAFl//ttU/grCIYQAHI1JW/aR4wao+6vmfUVDscHJjcuXHhN0rn7VReQf3funmvAQBGWHdPbb2DpiFhz+hWRQBmTkwQosBOg0o765mYbQ382P3B+sQSogmXOF2Dr1Vbdb7baVTahJrxLrrdsvCadN6+bWbcQQ2Mf6smff6lrZGD+OKn3ofEcEYRbIKasicRL2g0Za/n0xkEGVSzJ+lICJ4u0ExPkVb1R9TCb4LkQTnro4OEMaFvsnpJjbvYiKSTlRizAjnK5hThN/sp+JWBx5g9ED4043voq3TCVBSbLVf0d1GDNQYnOOGgEByiZX/kZzz17Jj5m4Qburq5WuixNHrTf3BXvsuuWCc7rTwuLru2r4FkgpA35dWNcHvr/p6etjpdZsDdu5CvQMeSwUZbE7lBtg8C1V+vjEck8SglH/5C8nmGr2A0lxfuD5CZMqcsYbYhkQ5DGLkwS3P6c3FT1sBvR0CrXQ4cNGaDw0008Rfok0gpbhwyvOCMVX41cuGvPS7h5etQGtPfQVFnvkjfCKY7n3mPsVwoPjhRWjpiLjSZGdTrshkvllSc7Nl+MlQoELBmU9rlev2BuPBp0G8VFgVs9Al X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ea68a87-5e89-4b5c-e9d8-08dcc25c2cc7 X-MS-Exchange-CrossTenant-AuthSource: PUZPR06MB5620.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 03:40:32.5345 (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: 6FcgWWaN4vCk6CEBlJBtTRwuBf38YcctL1rS2aaxTsRm6dglKTBbZR/FnFUynH1kG+b5DIFCU0e0rllYqgWsmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6565 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_204041_404027_5E608F7F X-CRM114-Status: GOOD ( 12.00 ) 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/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c index 670d2ca0f757..6ddc4262d22b 100644 --- a/drivers/tty/serial/8250/8250_uniphier.c +++ b/drivers/tty/serial/8250/8250_uniphier.c @@ -180,16 +180,12 @@ static int uniphier_uart_probe(struct platform_device *pdev) memset(&up, 0, sizeof(up)); - priv->clk = devm_clk_get(dev, NULL); + priv->clk = devm_clk_get_enabled(dev, NULL); if (IS_ERR(priv->clk)) { dev_err(dev, "failed to get clock\n"); return PTR_ERR(priv->clk); } - ret = clk_prepare_enable(priv->clk); - if (ret) - return ret; - up.port.uartclk = clk_get_rate(priv->clk); spin_lock_init(&priv->atomic_write_lock); @@ -222,7 +218,6 @@ static int uniphier_uart_probe(struct platform_device *pdev) ret = serial8250_register_8250_port(&up); if (ret < 0) { dev_err(dev, "failed to register 8250 port\n"); - clk_disable_unprepare(priv->clk); return ret; } priv->line = ret; @@ -237,7 +232,6 @@ static void uniphier_uart_remove(struct platform_device *pdev) struct uniphier8250_priv *priv = platform_get_drvdata(pdev); serial8250_unregister_port(priv->line); - clk_disable_unprepare(priv->clk); } static int __maybe_unused uniphier_uart_suspend(struct device *dev)
The devm_clk_get_enabled() helpers: - call devm_clk_get() - call clk_prepare_enable() and register what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids calls to clk_disable_unprepare(). Signed-off-by: Lei Liu <liulei.rjpt@vivo.com> --- drivers/tty/serial/8250/8250_uniphier.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)