From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 0FBA41CB319; Thu, 22 Aug 2024 13:22:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724332930; cv=none; b=IrCBMOCHAnA1Y8vEDX/ETUJLOyTIY6YSXqOsoCCZksSB8tAIEd2D78SCyiOrMvt48jos/kq90dt7ND2qRnYURgyrOQ20kLO5QpoZNXSgzyq3rOeQPo/4Xqv2AfxM23s4eGk2yUb8vuFagRsUzhEm+czW1lLIqo/+Iwo1FCi+M4M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724332930; c=relaxed/simple; bh=6lUyVJL682/y+zHKSdeUnO1XoMkcTCqidWCSE5Cgcds=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WOsGw7avhJ8ofFOvtV4OvmjcvSQjgVNorHCT7QvS6/qLDvpkBXM/1tUZCWSNQOAq5LlTYmuSm4X/yXNOWNz4Qu6NI1miU4SrF9W3Bh+tzvxI1fxlNHHwDuCxdv77hB9Y8N2WTAIXmud7mEnrqH/Zsqf6TevAVzh2mw29d4OzUxQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=dLpMf/uz; arc=none smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dLpMf/uz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724332929; x=1755868929; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=6lUyVJL682/y+zHKSdeUnO1XoMkcTCqidWCSE5Cgcds=; b=dLpMf/uzpJ9gyC7mJtyVDFrAlN9TDUBOjQLNP5QTLWqExauqjFJbZEOf C55fXCVx+pkfEMy0ueE/nvFuA4TeXYytzpZTxzBWaSpZ+vnW3k+dnor+u EOJ4qPvP325r6F1v+Lnl1SCaidAbaWX0M5T1mWcTjZ60lyP+8qfYdo3xl XJ9320PdqHJHrXioRvboHgThAhxvgtDVHVz4ZDa3BQZ28UHpliBSLs7xp PPicJci7OVNsjGiY0NzVSiW5zVdjRP/CDhyBnx+6NWDIHsudXhZ3m0tRj 6zO/haCKF6xu0f3Fyncijh1/5el6YzoxUKQS1hucQAgyH//5oKHKr8yBl g==; X-CSE-ConnectionGUID: aa3otHPtQfq1HMWgAtRA5A== X-CSE-MsgGUID: dM2C/5CLRPSgtJNmpyu9ig== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="22268332" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="22268332" 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 Cc: Paul Cercueil , Greg Kroah-Hartman , Jiri Slaby , Thierry Reding , Jonathan Hunter , Kunihiko Hayashi , Masami Hiramatsu , Richard Genoud , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , Andreas =?iso-8859-1?Q?F=E4rber?= , Manivannan Sadhasivam , Patrice Chotard , Maxime Coquelin , Alexandre Torgue , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Geert Uytterhoeven , Andi Shyti , John Ogness , Thomas Gleixner , Sebastian Andrzej Siewior , Jeff Johnson , Valentin Caron , Lino Sanfilippo , Erwan Le Ray , 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, opensource.kernel@vivo.com 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> Precedence: bulk X-Mailing-List: linux-tegra@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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