From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 A5E44C52D7C for ; Thu, 22 Aug 2024 13:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To :Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jE53U8me8qy3/SyYU8Wmr3qR2rVQ+cub3P6BGU3MhQo=; b=FKKemyDO/UrS4Tq+5Qn4W3HmLC cxFMUs/CPLFcQwX6MH+fGFTI7ho88wn441LTakOQ+/GMR0vYiVHXIGlsWtY2jMjvG/wPHXT1f015I B32e5fvwhbb/xMGS40g0VHwkWA4XGkCCSX2Slm2HuPyVWgaey+ad92abgR93KsErSjMhM1qcabixL 0lm1CpLDtUgEwtSUqLsg096ibHAzVPM973uO3QRMSLA7iicMTJUWaD6+KXr4SY+WNusRyzHshgJU4 fLjSLmmc2wWJ95OA4JFbQyprbGlSJ2MSHNR+8+XXmZIXsgLjvyATP3y8VVyoYHh7XskME+vSVyHZz pvYupiLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh7mI-0000000CuSV-0Z9d; Thu, 22 Aug 2024 13:23:02 +0000 Received: from mgamail.intel.com ([192.198.163.18]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh7lV-0000000CuCb-22yx; Thu, 22 Aug 2024 13:22:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724332933; x=1755868933; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=6lUyVJL682/y+zHKSdeUnO1XoMkcTCqidWCSE5Cgcds=; b=F621IYLT7dCqm0kfKBP5rxviQ31numeRQRI9dY8PyPjdd65Lt4NTj+P6 Dk4XfFsVBCtXKuq/DBqvxjsD3VFJsOl0FH7A56sy0TbJuW2a4tAWyWyEA P/nYeisEnQ39vjnfnn4R4rE1ZUwC1ZaW0rWAkoLfgrdYBiAIuBV/NbEGY YBhu+nXd41PW5Ee+IUvSowUb8N16nYGgAb7d7gUw9WDYoSrL/VbDTNLNi aw68iKHRoBqCj4T7ARjFoYLhf8u9YPzZMMqiYm7scowsw4mZfu9Yr1zRO Ygrg+saVB06uF2XwnBVcsH7N5LWgS4aGcjQSoajx/sq8tEJKmPx5w0e4j A==; X-CSE-ConnectionGUID: 2I01llEMTY+kh3ugYbWQYw== X-CSE-MsgGUID: qek31RXqQtuEeXLwWBNzdw== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="22268340" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="22268340" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 06:22:08 -0700 X-CSE-ConnectionGUID: mIssrLQYQ4eMGfz/yeBcfA== X-CSE-MsgGUID: 7UrOXBtlTwKCxSEkW+YKnw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="66126744" Received: from smile.fi.intel.com ([10.237.72.54]) by fmviesa004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 06:22:00 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.98) (envelope-from ) id 1sh7lD-00000000SgH-0pqd; Thu, 22 Aug 2024 16:21:55 +0300 Date: Thu, 22 Aug 2024 16:21:54 +0300 From: Andy Shevchenko To: Lei Liu Subject: Re: [PATCH 7/8] tty: st-asc: Use devm_clk_get_enabled() helpers Message-ID: References: <20240822033924.32397-1-liulei.rjpt@vivo.com> <20240822033924.32397-8-liulei.rjpt@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240822033924.32397-8-liulei.rjpt@vivo.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240822_062213_584947_66472618 X-CRM114-Status: GOOD ( 14.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Valentin Caron , Erwan Le Ray , Geert Uytterhoeven , Lorenzo Pieralisi , Liviu Dudau , Alexandre Torgue , Claudiu Beznea , Paul Cercueil , Thierry Reding , Manivannan Sadhasivam , Jiri Slaby , linux-stm32@st-md-mailman.stormreply.com, opensource.kernel@vivo.com, Kunihiko Hayashi , Jonathan Hunter , linux-arm-kernel@lists.infradead.org, Andi Shyti , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-mips@vger.kernel.org, Patrice Chotard , linux-serial@vger.kernel.org, John Ogness , linux-kernel@vger.kernel.org, linux-actions@lists.infradead.org, linux-tegra@vger.kernel.org, Thomas Gleixner , Richard Genoud , Sebastian Andrzej Siewior , Greg Kroah-Hartman , Lino Sanfilippo , Masami Hiramatsu , Maxime Coquelin , Sudeep Holla , Jeff Johnson , Andreas =?iso-8859-1?Q?F=E4rber?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 22, 2024 at 11:39:11AM +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(). ... Same caveat as in another patch comment. > - ascport->clk = devm_clk_get(&pdev->dev, NULL); > + ascport->clk = devm_clk_get_enabled(&pdev->dev, NULL); > > if (WARN_ON(IS_ERR(ascport->clk))) > return -EINVAL; > - /* ensure that clk rate is correct by enabling the clk */ > - ret = clk_prepare_enable(ascport->clk); > - if (ret) > - return ret; > + > ascport->port.uartclk = clk_get_rate(ascport->clk); > WARN_ON(ascport->port.uartclk == 0); Btw, not related to this series, you may try to get rid of these 0 checks as the serial core has this and it will fail anyway. Perhaps you want to expand serial core to issue an error message (if it's not done yet). > - clk_disable_unprepare(ascport->clk); -- With Best Regards, Andy Shevchenko