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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37C83C678D4 for ; Mon, 6 Mar 2023 12:01:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbjCFMBp (ORCPT ); Mon, 6 Mar 2023 07:01:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbjCFMBi (ORCPT ); Mon, 6 Mar 2023 07:01:38 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E85B1F915 for ; Mon, 6 Mar 2023 04:01:36 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZ9X3-00016l-Sj; Mon, 06 Mar 2023 13:01:33 +0100 Received: from pza by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1pZ9X2-0004hV-FY; Mon, 06 Mar 2023 13:01:32 +0100 Date: Mon, 6 Mar 2023 13:01:32 +0100 From: Philipp Zabel To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH] misc: sram: Improve and simplify clk handling Message-ID: <20230306120132.GA15995@pengutronix.de> References: <20230302091251.1852454-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230302091251.1852454-1-u.kleine-koenig@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: pza@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 02, 2023 at 10:12:51AM +0100, Uwe Kleine-K?nig wrote: > The current code tries to get an associated clk, ignores any errors in the > process and if there is a clock enables it unconditionally for the whole > lifetime of the sram device. > > Instead use an "optional" variant of devm_clk_get() which handles the case > where no clk is needed for the sram device and do proper error handling > for the remaining error cases. Also use an "enabled" variant of > devm_clk_get() to simplify. With that .probe() is the only function using > struct sram_dev::clk, so it can be replaced by a local variable. > > Signed-off-by: Uwe Kleine-K?nig Reviewed-by: Philipp Zabel regards Philipp