From patchwork Wed Oct 31 08:29:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10662145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1DB8713BF for ; Wed, 31 Oct 2018 08:30:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07C462A313 for ; Wed, 31 Oct 2018 08:30:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEB8E2A32C; Wed, 31 Oct 2018 08:30:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9D5622A313 for ; Wed, 31 Oct 2018 08:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JFWRRtS3SaN/E7WVKkvbCWM8uA/45n/1B+b/Pw2iONY=; b=dTlR+NOMXnBSfe vXtPoyvsm3Am5s6h6NnTszKlhk++u2Fg/k6dfrkMNSLjXwLig8czXEga7sygPe9z26c07CLMPZbj5 yjm8E6mOXlPCiwvAnJUZuwh8p8DimYE3R/VrfVXCELFLozL3FLWVL86PbTEl7mcT1nO8si2v8Iy7e PRJqEYBDxS280qeVbH1E9wWGnaP8lTpxdT1wep1CjTa9RGFaPLfsPnD6d2QYY5GsZv6Wof5Szno/1 fw+oRwOxCws3hGrbCZjzgJZKa+45ol8bBSCQ42gYlmkuWRrCssW71JpAtIV5BXyfVnAQ1hCRwvyUG GkpCz1fSCzF5I12otEbg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHltL-0005we-7X; Wed, 31 Oct 2018 08:30:19 +0000 Received: from mail-lj1-f195.google.com ([209.85.208.195]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHltG-0004qa-Tv for linux-arm-kernel@lists.infradead.org; Wed, 31 Oct 2018 08:30:17 +0000 Received: by mail-lj1-f195.google.com with SMTP id s15-v6so14009443lji.3 for ; Wed, 31 Oct 2018 01:30:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=J86aAgGejyXGR4d0DwCOqCZU/jYNSzK0ZBDTevgbO7k=; b=AdT84QIrP2ewR4nH+XuxxP3zGO30XavMS8k9LfURDkPmxbbRB7nRuMOGzg0cpLr3Jp osEVKUPysKU50tx76VJpecmylM8ACMNuaMfsJaDVSvKsSnVL2CQ6M68DGGJctuWvLiGn NDjB3bFCHJ6X2aRqu8Jol+OlAz6cgsFETFmZVFnBmeAcW0KO57Keg/QQ1ICfQtBDCpEP nd27BgZsFZh+oSS+1ohkzndoS93bS3nUZnd1mEiXdyDZbelV83WozkZBNGf67OMVbPrI Lb7sIB6WEkpYAj9/2sqxvlkFkzGyMJHKrim9HElUVEOJDCb9FpV3VGGx5BCzKLKKDHzl HgJw== X-Gm-Message-State: AGRZ1gLUFgMcnXhKuyEPYrghUXS2wTz7rFLvTRW/CpiNBIt8TjdSVbFR 5ws2qw4iLqu/wBzKUeqc5DM= X-Google-Smtp-Source: AJdET5e7vg1bM5i6SW182p0qKsty5NsWsnVeXqu530iDwvT8ODVLEG2wr3fQlgi/31k/Lw0tasWFVQ== X-Received: by 2002:a2e:5b93:: with SMTP id m19-v6mr1147367lje.115.1540974602567; Wed, 31 Oct 2018 01:30:02 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id t73-v6sm3630712lje.23.2018.10.31.01.30.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Oct 2018 01:30:01 -0700 (PDT) Date: Wed, 31 Oct 2018 10:29:53 +0200 From: Matti Vaittinen To: Jonathan Corbet , Michael Turquette , Stephen Boyd , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Russell King , Andy Gross , David Brown , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Andrey Smirnov , Sebastian Reichel , Guenter Roeck , Rob Herring , Matti Vaittinen , Huang Shijie , Akshu Agrawal , "Rafael J. Wysocki" , Daniel Kurtz , mazziesaccount@gmail.com Subject: [PATCH 0/8] clk: clkdev: managed clk lookup and provider registrations Message-ID: MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181031_013014_964884_7B46EB5B X-CRM114-Status: GOOD ( 16.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Patch series adding managed clkdev and of_provider registrations Few clk drivers appear to be leaking clkdev lookup registrations at driver remove. The patch series adds devm versions of lookup registrations and cleans up few drivers. There is no intended functional changes besides adding clean-ups at remove or simplifying the clean-up code by using devm. So this patch series is not fixing any potential issues on binding the cleanups to parent device - this series only changes the cleanup to be done using devm. Driver clean-up patches have not been tested as I lack the HW. All testing and comments if driver/device removal is even possible for changed drivers is highly appreciated. If removal is not possible I will gladly drop the relevant patches from series - although leaking lookups may serve as bad example for new developers =) Changed drivers are: clk-max77686, clk-s3c2410-dclk, clk-st, clk-hi655x, rk808, clk-twl6040 and apcs-msm8916. New devm registration variants have been tested on BeagleBoneBlack using ROHM BD71837 PMIC driver. Same devm variants were earlier proposed together with BD71837/BD71847 PMIC clk driver in this series: https://lore.kernel.org/linux-clk/cover.1535630942.git.matti.vaittinen@fi.rohmeurope.com/ The BD71837/BD71847 work is currently pending for related MFD commits to get merged in clk-tree and the devm functions are now submitted in this series. This patch series is based on clk-next --- Matti Vaittinen (8): clk: clkdev/of_clk - add managed lookup and provider registrations clk: clk-max77686: Clean clkdev lookup leak and use devm clk: clk-s3c2410-dclk: clean up clkdev lookup leak clk: clk-st: avoid clkdev lookup leak at remove clk: clk-hi655x: Free of_provider at remove clk: rk808: use managed version of of_provider registration clk: clk-twl6040: Free of_provider at remove clk: apcs-msm8916: simplify probe cleanup by using devm Documentation/driver-model/devres.txt | 3 + drivers/clk/clk-hi655x.c | 4 +- drivers/clk/clk-max77686.c | 25 ++----- drivers/clk/clk-rk808.c | 15 +--- drivers/clk/clk-twl6040.c | 5 +- drivers/clk/clk.c | 28 ++++++-- drivers/clk/clkdev.c | 122 ++++++++++++++++++++++++++------- drivers/clk/qcom/apcs-msm8916.c | 5 +- drivers/clk/samsung/clk-s3c2410-dclk.c | 15 ++-- drivers/clk/x86/clk-st.c | 3 +- include/linux/clk-provider.h | 4 ++ include/linux/clkdev.h | 4 ++ 12 files changed, 151 insertions(+), 82 deletions(-)