From patchwork Wed Jun 9 20:21:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12311149 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,INCLUDES_PULL_REQUEST, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB7D0C48BD1 for ; Wed, 9 Jun 2021 20:21:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7C2E613DC for ; Wed, 9 Jun 2021 20:21:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229792AbhFIUXm (ORCPT ); Wed, 9 Jun 2021 16:23:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbhFIUXk (ORCPT ); Wed, 9 Jun 2021 16:23:40 -0400 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 0D0B7C061760 for ; Wed, 9 Jun 2021 13:21:45 -0700 (PDT) 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 1lr4hc-0002WB-Au; Wed, 09 Jun 2021 22:21:28 +0200 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lr4hX-0003g3-WB; Wed, 09 Jun 2021 22:21:24 +0200 Date: Wed, 9 Jun 2021 22:21:23 +0200 From: Uwe =?utf-8?q?Kleine-K=C3=B6nig?= To: Stephen Boyd Cc: Michael Turquette , linux-rtc@vger.kernel.org, linux-pwm@vger.kernel.org, Alexandre Belloni , Alessandro Zummo , Mark Brown , Nicolas Ferre , linux-clk@vger.kernel.org, Wolfram Sang , Oleksij Rempel , Ludovic Desroches , Thierry Reding , Alexandru Ardelean , kernel@pengutronix.de, Jonathan Cameron , Andrew Morton , linux-spi@vger.kernel.org, Lee Jones , Claudiu Beznea , linux-arm-kernel@lists.infradead.org Subject: [PULL] Add variants of devm_clk_get for prepared and enabled clocks enabled clocks Message-ID: <20210609202123.u5rmw7al4x3rrvun@pengutronix.de> References: <20210510174142.986250-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210510174142.986250-1-u.kleine-koenig@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Hello Stephen, given that I don't succeed in getting any feedback for my patch set, I'm trying with a pull request today. It would be really great if this pull request made it finally in for the next merge window. The changes are not as bad or complex as the diffstat suggests. The first patch contains all the complexity and only has 1 file changed, 50 insertions(+), 17 deletions(-) . The second patch makes use of this and just adds kernel-doc, four functions that are one-line wrappers around the newly introduced __devm_clk_get() function in the first patch and dummy implementations for the !CONFIG_HAVE_CLK case. The following changes since commit 6efb943b8616ec53a5e444193dccf1af9ad627b5: Linux 5.13-rc1 (2021-05-09 14:17:44 -0700) are available in the Git repository at: https://git.pengutronix.de/git/ukl/linux tags/devm-clk-get-enabled for you to fetch changes up to fec74d434d6f6016b6b2d5ab13aa28a0c657f5fb: clk: Provide new devm_clk_helpers for prepared and enabled clocks (2021-05-11 14:20:13 +0200) ---------------------------------------------------------------- New variants of devm_clk_get() for prepared and enabled clocks These two patches create a set of new devm helpers that return clocks already prepared or prepared-and-enabled. The automatic cleanup cares for unpreparing and disabling+unpreparing respectively. This allows to simplify various drivers as was demonstrated with additional patches sent with the various revisions of this patch set. See https://lore.kernel.org/r/20210510174142.986250-1-u.kleine-koenig@pengutronix.de for the last submission round. This pull request doesn't contain these patches though. ---------------------------------------------------------------- Uwe Kleine-König (2): clk: generalize devm_clk_get() a bit clk: Provide new devm_clk_helpers for prepared and enabled clocks drivers/clk/clk-devres.c | 96 ++++++++++++++++++++++++++++++++++++++++-------- include/linux/clk.h | 90 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 169 insertions(+), 17 deletions(-)