Message ID | 20240822033924.32397-3-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 7B926C52D7C for <linux-arm-kernel@archiver.kernel.org>; Thu, 22 Aug 2024 03:42:25 +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=1r3BMP1FBquX5ukAVmQnyy2vqTNUoSxsqb+JL74roAQ=; b=RKcViI4WzjycHJiuOh34R60/o0 0u6rwcgEvtWvocU4oFrBdGONsbNXB9i9Djh0sWs3KysYR9+dHz8cmuP9LnNT54DBUgMdsrMtsTZMi ej+UthJIKCATdSGFnN2kCIo9skNsdSA1Zm726BOUKGXlGB8JolTRF3ovJlpJpvmQxY6oQXbEM+hry 5HutuCQXq3szU9Xo8ReQE80FvdEWtCdWjwlVkWYLZ1M0UGP9Iq1z2oUOLFV47UuhXnxK1U+gyIujH x4xj6iwP4aGIunaxBdHm802vY2Kh5cvSuMlsQsxnZBA81xozDMTsxc8wqO/++rPDj/mDBYXY7lwrl hPORsaMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgyiB-0000000BFUQ-0GPX; Thu, 22 Aug 2024 03:42:11 +0000 Received: from mail-sgaapc01on20628.outbound.protection.outlook.com ([2a01:111:f400:feab::628] helo=APC01-SG2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgygT-0000000BEwl-2kYM; Thu, 22 Aug 2024 03:40:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ApIjj4xwrqe4fCIEc2buyqhsKEHyMc8Qc8ce7eG2PFjKHc/f0HG8SoP1Vjd5UDWIfcSR5RfcM4bkpD62Zj09cySE5jk6XvkI5OQuVT5W1hlhfPB/eUi90xU7shEInl/Wvw8TYCoIZUDI4mY2vN96HybELhSQ1Obk/w2+YJiVZctdYQf62ErKVFDtUz90QGxocRvujDBGKPGCfNsw9c5/rXeUA2mhDr5/0hVpa1ncei6eSyODLQo8726oN1waaDVGDVjMRdTCbdINoPH80PfsxvEA+uHusJWUu6ugpvkkd+icmOqsgpTrOdWwt19KCyTQu8pDXHQx6lxlHxJjxwhk+g== 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=1r3BMP1FBquX5ukAVmQnyy2vqTNUoSxsqb+JL74roAQ=; b=IoDlQE4TSnbvlFv7AFuAqlMIgG11sPjgakXQQgQfTIaJS2qXBg0UWgcbO4YHebHYZSigYHqnCqgtVfrkzmtjLEeN831umEYPblk1gQtY0J9jZe5FKgi8OZKIGKhgz2ah5dHVKuUDjyME9Yr4UMKp5cRTPdLD1xbehNU+HN0ZgwKR1+SpcTqYF7b6LmThSdtXyd6GuabBJ+LLawj45Y8G7S1qK1WN/IW4jCX3vmcjkpI95HbDJ13+6+qAGaKxXZnG5Xvm1IPbJzL5SUYza8l9NNdF1+SGY8tP1DP1JjqIJZeFaVUI+eGTEJgNHu4APIuzXrfEVCHua4//LRI5AMlSDg== 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=1r3BMP1FBquX5ukAVmQnyy2vqTNUoSxsqb+JL74roAQ=; b=afglBshmBJLHeJa34Y1jwwRFG2mw3ztvrQq+BvicoWodb3gGtZBKKQ8CIs9+Cw8N8C18WJurdfwrex+Dkecqkf9+4Yt8IxylUNty4H6rVHDTYrq1udIV2vEIZyMpXBMoa9lWLkgdmHNFOjKSGXmkb4TmbVyf9MhzA9ujcMyvC4UitvptrbPw+TydxioAjpuKLFzoPjxngMp0UpiVNGRh7d37DszrBzuLVGCR6yTCXQaw4luGvcwACN19dpOr8pJb3U3Vsd7z/PUjADAxPrJ1/gsFvbN/SG4l09QfO1d9TjnyFJYeNXLZMAaW3IzNIeRHvaRWCLcxkNvXRkFH8jVT0Q== 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 TY0PR06MB4982.apcprd06.prod.outlook.com (2603:1096:400:1ae::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18; Thu, 22 Aug 2024 03:40:16 +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:16 +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>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Florian Fainelli <florian.fainelli@broadcom.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, 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>, Amelie Delaunay <amelie.delaunay@foss.st.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 2/8] tty: 8250_tegra: Use devm_clk_get_enabled() helpers Date: Thu, 22 Aug 2024 11:39:06 +0800 Message-Id: <20240822033924.32397-3-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_|TY0PR06MB4982:EE_ X-MS-Office365-Filtering-Correlation-Id: c131b6cb-d370-4ce6-2def-08dcc25c22e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: 8BPbImClTiTfGKByfvMBUjdmwqGzTZephM3ILcfY9dOULHvihyLZWp2f9KNdXrZlKW3mEJ1H9cllGbl+O2rL2U7EAp1ZV664tmQUhOB65ziCF8GzPP1ATztc4KViGYcelVMo5PKblSj27NAbX7maDSocupt5cEJX8RDVJ6N4Sv5BnlhgJR0hdSa13I1cCXVwClvT3dHcRh/VFdvmYmPX0OdRe6J7aGfcqTy/EuyNqFq5PXA+NEX+Qc+3OMPMsj/+lJSmBP0Z5kdVu7puIpoGu01pxbf/r1LKnzd5kz6yzs4SDX18Rn7w1PgTz0F6gF9+87fIWdCHflfoRNUSbfnIiNoxs2fCRZFi4yePMXLoOLsWrN21oD6CtYNnwhLBwOcOAtDhnIfg+MK3Eu9UgurmrEdBWB6UZcLR6I56zvXbJC2Xjl78vYo176NjiMZqCqdW/cKvcQUyVbxk3OuWj97LfsHp9DxjXssJC75mcVp2nD3sp82KDabCgqJvWWawZXvQ7ZUHVrSTjziBFVXH/Hhdv06yoECyHUJnk1Qy4C66ovJPkTdU+MaiR/rKsFjBmlYtCBgKhlSO8siNBtcQoaBkSq3bhv/P+FqFVORCDbWDNHJA6SZvGL/i1Bpmxr2w6PynkDmNgt4Jn/5LBs1GOMmcRWQvEjwBo+ukrg7KviDyoax1fW1KVAoi+xauBuzIysc0oV3/b8Svfuq2FNKtSG98pPGn0zX7py+mpFFy/kdI16I7AeekNI0tB6hDCzwe8qajlSpxHwB3mPHYF2Nxhyvmb5afHspYvsgDWJbM4B3KT+1491MxjTyprX+yOkj0VteWtk0E0tUQIL/AY+NSrxRpgWZv66Criaq9C03lAiTsqdsHid7BaeE7sPPgb0lNBaoN8gQNTbfRrKib9NNEEuJHcqcG6A2NONkHR4XG6pbjMyzvzEAcz/n9Kl/UT1TyvgFLffwkld6W/2AzUQg06m2UDFHT+LHXHJR4ovILtCAjtMOBtfBa5t8ytgEmJrQd5igCGqyIMpK2bJTyTCr5JqHsriWresA8qoWvnMArT5ONaNuohSWN9yUCtBheWz/3TLDgucwy0Lwi6qZ4e0IOVBTbVBfkR5N/h/bhPu9kvf+FPNz6HdcEPbeAF0oquvzN1hblBozi7jT+qzCNbsONHxrclFHdvSkfmB1WAYqCYtlmPZ5hMnN5oDwhU3iGCZlgM8RPqWfaJTUPwT9SnRCKgDrq6Xy+yN8OpR+toTGxRNa+04mxb/t6FWMKUkly6j6BnDDDvK9+ZSW17qW0A663KtQZAtyGwqf92PQqtXxffJmJCsLCeoonOQqZ0sOKAWg+6WdgYZYEhXy4Iya8XqfAetKRSTMJe/DCfVZS7TZhS7BKt4oh+Y4SKn7guBedQ/d8AwIO2ACR7V8lkmfccdowWs1ga4p2WWnl1r2gF0G1vqm56Ds= 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)(7416014)(376014)(52116014)(921020)(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VgKI6M2CEoECti9zTWP+8bNmcQSjz0SJ8uc04AzxJL9yZMnBfzZ8ss4qHzBQY2IGYZcxNzl/YjkY9YbrSkb06DyfPOYQI1zEIBQqiVMmY6qnb9B2Dqkks4Tt9OmZrlNZwHGL6nVZQ33YfB9MPhfHMIMuJPC4yqU1Hu9877jG7nrePXWpiYpWHeInOwj13Q3nDXCEF95FKssN6ycI/shEoFSt85+rr4xQvpQHi+9UQTcE7eYVj7xLOH1zWAzDOz+fVSabZC4pOTuc6J2VaVvwHqZhD7x+d4VMLh8P9loiZAT0ZdpFT03N6y5tWp89bWhuKFfHY2NzlydVbQgKIWAl2PXYV7gJh02G3VByjPbYk/j/qmDcwt9bNESHHtr3zJeOixCrPmb9whu6VCxgL1HDefonYSqJC36n8Ky52egucn9e13L/J35CtdNJeR+V8Nzb1nIkUhxAvDdinj2pTuWCBlBrGNiw9wWoqHE3yUOG8lS8dYaEw3UWo8ZyBRxH347iM0qoid896jLpkUa0XYYUv0nwS+b5Jjl6HUzIPbY6hMXISYFWvbO0hUq+gKy1OozeT7s0mUkcaRFABzZLkDgZsvDpSrBd/MWFoRVdRvp X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c131b6cb-d370-4ce6-2def-08dcc25c22e4 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:15.9677 (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: fLLQb96ugYAbmegAbSuPjryD6A1WTb7Zm6UQf2fEjCWVI7AQU3GooNbIBjsaib3D4EEos2Otdf99QcLFcbkz7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB4982 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_204025_723260_55D4262E X-CRM114-Status: GOOD ( 11.82 ) 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
|
On Thu, Aug 22, 2024 at 11:39:06AM +0800, Lei Liu wrote: > 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(). ... > err_clkdisable: > - clk_disable_unprepare(uart->clk); > > return ret; Now this label (err_clkdisable) becomes redundant and code may use return ret in-line.
diff --git a/drivers/tty/serial/8250/8250_tegra.c b/drivers/tty/serial/8250/8250_tegra.c index 60a80d00d251..a38a4eb3235b 100644 --- a/drivers/tty/serial/8250/8250_tegra.c +++ b/drivers/tty/serial/8250/8250_tegra.c @@ -86,16 +86,12 @@ static int tegra_uart_probe(struct platform_device *pdev) return PTR_ERR(uart->rst); if (!port->uartclk) { - uart->clk = devm_clk_get(&pdev->dev, NULL); + uart->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(uart->clk)) { dev_err(&pdev->dev, "failed to get clock!\n"); return -ENODEV; } - ret = clk_prepare_enable(uart->clk); - if (ret < 0) - return ret; - port->uartclk = clk_get_rate(uart->clk); } @@ -115,7 +111,6 @@ static int tegra_uart_probe(struct platform_device *pdev) err_ctrl_assert: reset_control_assert(uart->rst); err_clkdisable: - clk_disable_unprepare(uart->clk); return ret; } @@ -126,7 +121,6 @@ static void tegra_uart_remove(struct platform_device *pdev) serial8250_unregister_port(uart->line); reset_control_assert(uart->rst); - clk_disable_unprepare(uart->clk); } #ifdef CONFIG_PM_SLEEP
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_tegra.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)